diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-06-19 15:15:53 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-06-19 22:57:57 +0200 |
commit | e743bfba0fb233cd08e1099d6cfa9b7533462bd0 (patch) | |
tree | d442d53edcc1c9865d5a2170b6f1c3c22e83481a | |
parent | 1a5f9e5af2ba6cd74e70f5f3fc528f7504ce1d82 (diff) | |
download | arctica-greeter-e743bfba0fb233cd08e1099d6cfa9b7533462bd0.tar.gz arctica-greeter-e743bfba0fb233cd08e1099d6cfa9b7533462bd0.tar.bz2 arctica-greeter-e743bfba0fb233cd08e1099d6cfa9b7533462bd0.zip |
src/: Skip start_notification_daemon() and start_real_wm() if in test-mode.
-rw-r--r-- | src/arctica-greeter.vala | 126 |
1 files changed, 66 insertions, 60 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index a30a8e3..e90bcb0 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -1065,28 +1065,31 @@ public class ArcticaGreeter : Object public void start_notification_daemon () { - try + if (!test_mode) { - string[] argv = null; + try + { + string[] argv = null; - if (FileUtils.test ("/usr/lib/mate-notification-daemon/mate-notification-daemon", FileTest.EXISTS)) { - Shell.parse_argv ("/usr/lib/mate-notification-daemon/mate-notification-daemon --replace", out argv); + if (FileUtils.test ("/usr/lib/mate-notification-daemon/mate-notification-daemon", FileTest.EXISTS)) { + Shell.parse_argv ("/usr/lib/mate-notification-daemon/mate-notification-daemon --replace", out argv); + } + else if (FileUtils.test ("/usr/libexec/mate-notification-daemon/mate-notification-daemon", FileTest.EXISTS)) { + Shell.parse_argv ("/usr/libexec/mate-notification-daemon/mate-notification-daemon --replace", out argv); + } + if (argv != null) + Process.spawn_async (null, + argv, + null, + SpawnFlags.SEARCH_PATH, + null, + out notificationdaemon_pid); + debug ("Launched mate-notification-daemon. PID: %d", notificationdaemon_pid); } - else if (FileUtils.test ("/usr/libexec/mate-notification-daemon/mate-notification-daemon", FileTest.EXISTS)) { - Shell.parse_argv ("/usr/libexec/mate-notification-daemon/mate-notification-daemon --replace", out argv); + catch (Error e) + { + warning ("Error starting the mate-notification-daemon registry: %s", e.message); } - if (argv != null) - Process.spawn_async (null, - argv, - null, - SpawnFlags.SEARCH_PATH, - null, - out notificationdaemon_pid); - debug ("Launched mate-notification-daemon. PID: %d", notificationdaemon_pid); - } - catch (Error e) - { - warning ("Error starting the mate-notification-daemon registry: %s", e.message); } } @@ -1111,53 +1114,56 @@ public class ArcticaGreeter : Object public void start_real_wm () { - string wm = AGSettings.get_string (AGSettings.KEY_WINDOW_MANAGER); - if ((wm == "metacity") || (wm == "marco")) + if (!test_mode) { - try - { - string[] argv; - - Shell.parse_argv (wm, out argv); - Process.spawn_async (null, - argv, - null, - SpawnFlags.SEARCH_PATH, - null, - out windowmanager_pid); - debug ("Launched '%s' WM. PID: %d", wm, windowmanager_pid); - } - catch (Error e) + string wm = AGSettings.get_string (AGSettings.KEY_WINDOW_MANAGER); + if ((wm == "metacity") || (wm == "marco")) { - warning ("Error starting the '%s' Window Manager: %s", wm, e.message); - } + try + { + string[] argv; - Timeout.add (50, () => + Shell.parse_argv (wm, out argv); + Process.spawn_async (null, + argv, + null, + SpawnFlags.SEARCH_PATH, + null, + out windowmanager_pid); + debug ("Launched '%s' WM. PID: %d", wm, windowmanager_pid); + } + catch (Error e) { - try - { - string[] argv; - Pid wm_message_pid = 0; - - Shell.parse_argv ("%s-message disable-keybindings".printf(wm), out argv); - - Process.spawn_sync (null, - argv, - null, - SpawnFlags.SEARCH_PATH, - null, - null, - null, - null); - debug ("Launched '%s-message disable-keybindings' command", wm); - return false; - } - catch (Error e) + warning ("Error starting the '%s' Window Manager: %s", wm, e.message); + } + + Timeout.add (50, () => { - warning ("Error during '%s-message disable-keybindings' command call: %s", wm, e.message); - return true; - } - }); + try + { + string[] argv; + Pid wm_message_pid = 0; + + Shell.parse_argv ("%s-message disable-keybindings".printf(wm), out argv); + + Process.spawn_sync (null, + argv, + null, + SpawnFlags.SEARCH_PATH, + null, + null, + null, + null); + debug ("Launched '%s-message disable-keybindings' command", wm); + return false; + } + catch (Error e) + { + warning ("Error during '%s-message disable-keybindings' command call: %s", wm, e.message); + return true; + } + }); + } } } |