diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-03-01 12:36:02 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-03-01 13:40:38 +0100 |
commit | 812b0987119a199e6559b6ba9c96797b3cf33525 (patch) | |
tree | d048c682a0a58db40494e411e3e88ba8ea36f3d4 | |
parent | 4e6b30fc4592cf6bd56945d64ac2172a0232ef2a (diff) | |
download | arctica-greeter-812b0987119a199e6559b6ba9c96797b3cf33525.tar.gz arctica-greeter-812b0987119a199e6559b6ba9c96797b3cf33525.tar.bz2 arctica-greeter-812b0987119a199e6559b6ba9c96797b3cf33525.zip |
src/arctica-greeter.vala: Don't launch Lomiri-related DBus listeners in test mode. Allows one to run arctica-greeter in test-mode within a Lomiri session.
-rw-r--r-- | src/arctica-greeter.vala | 62 | ||||
-rw-r--r-- | src/greeter-list.vala | 17 |
2 files changed, 42 insertions, 37 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index 9b3b735..58ca6c7 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -685,39 +685,41 @@ public class ArcticaGreeter : Object return false; }); - Bus.own_name (BusType.SESSION, "com.lomiri.LomiriGreeter", BusNameOwnerFlags.NONE); + if (!test_mode) { + Bus.own_name (BusType.SESSION, "com.lomiri.LomiriGreeter", BusNameOwnerFlags.NONE); - dbus_object = new DialogDBusInterface (); - dbus_object.open_dialog.connect ((type) => - { - ShutdownDialogType dialog_type; - switch (type) + dbus_object = new DialogDBusInterface (); + dbus_object.open_dialog.connect ((type) => { - default: - case 1: - dialog_type = ShutdownDialogType.SHUTDOWN; - break; - case 2: - dialog_type = ShutdownDialogType.RESTART; - break; - } - main_window.show_shutdown_dialog (dialog_type); - }); - dbus_object.close_dialog.connect ((type) => { main_window.close_shutdown_dialog (); }); - Bus.own_name (BusType.SESSION, "com.lomiri.Shell", BusNameOwnerFlags.NONE, - (c) => - { - try - { - c.register_object ("/org/gnome/SessionManager/EndSessionDialog", dbus_object); - } - catch (Error e) + ShutdownDialogType dialog_type; + switch (type) + { + default: + case 1: + dialog_type = ShutdownDialogType.SHUTDOWN; + break; + case 2: + dialog_type = ShutdownDialogType.RESTART; + break; + } + main_window.show_shutdown_dialog (dialog_type); + }); + dbus_object.close_dialog.connect ((type) => { main_window.close_shutdown_dialog (); }); + Bus.own_name (BusType.SESSION, "com.lomiri.Shell", BusNameOwnerFlags.NONE, + (c) => { - warning ("Failed to register /org/gnome/SessionManager/EndSessionDialog: %s", e.message); - } - }, - null, - () => debug ("Failed to acquire name com.lomiri.Shell")); + try + { + c.register_object ("/org/gnome/SessionManager/EndSessionDialog", dbus_object); + } + catch (Error e) + { + warning ("Failed to register /org/gnome/SessionManager/EndSessionDialog: %s", e.message); + } + }, + null, + () => debug ("Failed to acquire name com.lomiri.Shell")); + } start_fake_wm (); Gdk.threads_add_idle (ready_cb); diff --git a/src/greeter-list.vala b/src/greeter-list.vala index f9ec31d..3c5af9f 100644 --- a/src/greeter-list.vala +++ b/src/greeter-list.vala @@ -184,13 +184,16 @@ public abstract class GreeterList : FadableBox scroll_timer = new AnimateTimer (AnimateTimer.ease_out_quint, AnimateTimer.FAST); scroll_timer.animate.connect (animate_scrolling); - try - { - Bus.get.begin (BusType.SESSION, null, on_bus_acquired); - } - catch (IOError e) - { - debug ("Error getting session bus: %s", e.message); + greeter = new ArcticaGreeter(); + if (!greeter.test_mode) { + try + { + Bus.get.begin (BusType.SESSION, null, on_bus_acquired); + } + catch (IOError e) + { + debug ("Error getting session bus: %s", e.message); + } } } |