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/main-window.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/main-window.vala')
-rw-r--r-- | src/main-window.vala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main-window.vala b/src/main-window.vala index 993e43e..172c6f4 100644 --- a/src/main-window.vala +++ b/src/main-window.vala @@ -159,7 +159,8 @@ public class MainWindow : Gtk.Window only_on_monitor = AGSettings.get_string(AGSettings.KEY_ONLY_ON_MONITOR); monitor_setting_ok = only_on_monitor == "auto"; - if (ArcticaGreeter.singleton.test_mode) + var greeter = new ArcticaGreeter (); + if (greeter.test_mode) { /* Simulate an 800x600 monitor to the left of a 640x480 monitor */ monitors = new List<Monitor> (); @@ -375,6 +376,7 @@ public class MainWindow : Gtk.Window } } + var greeter = new ArcticaGreeter (); switch (event.keyval) { case Gdk.Key.Escape: @@ -434,14 +436,14 @@ public class MainWindow : Gtk.Window } return true; case Gdk.Key.z: - if (ArcticaGreeter.singleton.test_mode && (event.state & Gdk.ModifierType.MOD1_MASK) != 0) + if (greeter.test_mode && (event.state & Gdk.ModifierType.MOD1_MASK) != 0) { show_shutdown_dialog (ShutdownDialogType.SHUTDOWN); return true; } break; case Gdk.Key.Z: - if (ArcticaGreeter.singleton.test_mode && (event.state & Gdk.ModifierType.MOD1_MASK) != 0) + if (greeter.test_mode && (event.state & Gdk.ModifierType.MOD1_MASK) != 0) { show_shutdown_dialog (ShutdownDialogType.RESTART); return true; |