aboutsummaryrefslogtreecommitdiff
path: root/src/arctica-greeter.vala
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-06-18 08:39:53 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-06-18 08:48:10 +0200
commitb9911e7d269d31861d8749d2cdca9c6c69cd4f14 (patch)
treebfc5ee26c144b141cb566c4bbf705d470766895b /src/arctica-greeter.vala
parentcf054d0442a0c8dcf0ac7fe6384353b9e989e40d (diff)
downloadarctica-greeter-b9911e7d269d31861d8749d2cdca9c6c69cd4f14.tar.gz
arctica-greeter-b9911e7d269d31861d8749d2cdca9c6c69cd4f14.tar.bz2
arctica-greeter-b9911e7d269d31861d8749d2cdca9c6c69cd4f14.zip
src/: Re-introduce having a window manager (metacity this time, with keybindings disabled). Make having it conifugrable via GSettings.
Diffstat (limited to 'src/arctica-greeter.vala')
-rw-r--r--src/arctica-greeter.vala66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala
index e7a049d..119f3af 100644
--- a/src/arctica-greeter.vala
+++ b/src/arctica-greeter.vala
@@ -1278,6 +1278,7 @@ public class ArcticaGreeter : Object
Pid atspi_pid = 0;
Pid nmapplet_pid = 0;
+ Pid windowmanager_pid = 0;
if (!do_test_mode)
{
@@ -1421,6 +1422,55 @@ public class ArcticaGreeter : Object
activate_upower();
+ string wm = AGSettings.get_string (AGSettings.KEY_WINDOW_MANAGER);
+ if (wm == "metacity")
+ {
+ 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)
+ {
+ warning ("Error starting the '%s' Window Manager: %s", wm, e.message);
+ }
+
+ Timeout.add (50, () =>
+ {
+ 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;
+ }
+ });
+ }
+
greeter.greeter_ready.connect (() => {
debug ("Showing greeter");
greeter.show ();
@@ -1514,6 +1564,22 @@ public class ArcticaGreeter : Object
debug ("GeoClue-2.0 agent terminated with signal %d", Process.term_sig (status));
geoclueagent_pid = 0;
}
+
+ if (windowmanager_pid != 0)
+ {
+#if VALA_0_40
+ Posix.kill (windowmanager_pid, Posix.Signal.TERM);
+#else
+ Posix.kill (windowmanager_pid, Posix.SIGTERM);
+#endif
+ int status;
+ Posix.waitpid (windowmanager_pid, out status, 0);
+ if (Process.if_exited (status))
+ debug ("Marco Window Manager exited with return value %d", Process.exit_status (status));
+ else
+ debug ("Marco Window Manager terminated with signal %d", Process.term_sig (status));
+ windowmanager_pid = 0;
+ }
}
gsettings_mate_desktop_interface.set_int ("window-scaling-factor", wsf_orig);