diff options
author | Mihai Moldovan <ionic@ionic.de> | 2022-12-06 02:49:19 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-02-06 08:30:01 +0100 |
commit | 32d28d7bf2646fc7a0008937034246fcc96dbc8a (patch) | |
tree | 3cb1098e9925ee291b13d285c80f1233751ed1c2 /src/menubar.vala | |
parent | 600fbb680106b697c1801fcd67aa51477743a30d (diff) | |
download | arctica-greeter-32d28d7bf2646fc7a0008937034246fcc96dbc8a.tar.gz arctica-greeter-32d28d7bf2646fc7a0008937034246fcc96dbc8a.tar.bz2 arctica-greeter-32d28d7bf2646fc7a0008937034246fcc96dbc8a.zip |
misc src/: make ArcticaGreeter a proper vala SingleInstance class.
This allows us to drop the rather awkward self-referencing static
singleton member and use a standard vala/glib feature.
Diffstat (limited to 'src/menubar.vala')
-rw-r--r-- | src/menubar.vala | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/menubar.vala b/src/menubar.vala index a2b6b99..3f9f72c 100644 --- a/src/menubar.vala +++ b/src/menubar.vala @@ -108,7 +108,8 @@ public class MenuBar : Gtk.MenuBar */ public void set_keyboard_state () { - if (!ArcticaGreeter.singleton.test_mode) + var greeter = new ArcticaGreeter (); + if (!greeter.test_mode) onscreen_keyboard_item.set_active (AGSettings.get_boolean (AGSettings.KEY_ONSCREEN_KEYBOARD)); } @@ -155,7 +156,8 @@ public class MenuBar : Gtk.MenuBar setup_indicators (); - ArcticaGreeter.singleton.starting_session.connect (cleanup); + var greeter = new ArcticaGreeter (); + greeter.starting_session.connect (cleanup); } private void close_pid (ref Pid pid) @@ -293,7 +295,8 @@ public class MenuBar : Gtk.MenuBar private void load_indicator (string indicator_name) { - if (!ArcticaGreeter.singleton.test_mode) + var greeter = new ArcticaGreeter (); + if (!greeter.test_mode) { if (indicator_name == "ug-accessibility") { @@ -484,7 +487,8 @@ public class MenuBar : Gtk.MenuBar // this is not racy with orca startup, it is racy with whether // orca will read the first character or not out loud. Hence // why we do both. Ideally this would be fixed in orca itself. - ArcticaGreeter.singleton.orca_needs_kick = true; + var greeter = new ArcticaGreeter (); + greeter.orca_needs_kick = true; Timeout.add_seconds (1, () => { Signal.emit_by_name ((get_toplevel () as Gtk.Window).get_focus ().get_accessible (), "focus-event", true); return false; |