Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions lib/IndicatorManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,6 @@ public class Wingpanel.IndicatorManager : GLib.Object {
return indicator_manager;
}

/**
* The type of the server displaying the indicator.
*/
public enum ServerType {
SESSION,
GREETER;

public string restrictions_file_name () {
switch (this) {
case SESSION :

return "default";

case GREETER:

return "greeter";

default:
assert_not_reached ();
}
}
}

/**
* Called when a new indicator was added.
*/
Expand Down
12 changes: 12 additions & 0 deletions lib/ServerType.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* SPDX-License-Identifier: GPL-2.0-or-later
* SPDX-FileCopyrightText: 2026 elementary, Inc. (https://elementary.io)
*/

/**
* The type of the server displaying the indicator.
*/
public enum Wingpanel.ServerType {
SESSION,
GREETER;
}
1 change: 1 addition & 0 deletions lib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ libwingpanel_lib = library(
'IndicatorManager.vala',
'KeybindingHelper.vala',
'PopoverMenuItem.vala',
'ServerType.vala',
config_header,
dependencies: [libwingpanel_deps, config_vapi],
vala_header: 'wingpanel-9.h',
Expand Down
4 changes: 2 additions & 2 deletions sample/SampleIndicator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ public class Sample.Indicator : Wingpanel.Indicator {
* This method is called once after your plugin has been loaded.
* Create and return your indicator here if it should be displayed on the current server.
*/
public Wingpanel.Indicator? get_indicator (Module module, Wingpanel.IndicatorManager.ServerType server_type) {
public Wingpanel.Indicator? get_indicator (Module module, Wingpanel.ServerType server_type) {
/* A small message for debugging reasons */
debug ("Activating Sample Indicator");

/* Check which server has loaded the plugin */
if (server_type != Wingpanel.IndicatorManager.ServerType.SESSION) {
if (server_type != Wingpanel.ServerType.SESSION) {
/* We want to display our sample indicator only in the "normal" session, not on the login screen, so stop here! */
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public class Wingpanel.Application : Gtk.Application {
VariantDict options = command_line.get_options_dict ();

if (options.contains (SERVER_TYPE_ACTION_NAME)) {
IndicatorManager.get_default ().initialize (IndicatorManager.ServerType.GREETER);
IndicatorManager.get_default ().initialize (ServerType.GREETER);
} else {
IndicatorManager.get_default ().initialize (IndicatorManager.ServerType.SESSION);
IndicatorManager.get_default ().initialize (ServerType.SESSION);
}

if (options.contains (TOGGLE_INDICATOR_ACTION_NAME)) {
Expand Down
Loading