aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arctica-greeter.vala2
-rw-r--r--src/settings-daemon.vala34
2 files changed, 34 insertions, 2 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala
index 160bcd2..75d82df 100644
--- a/src/arctica-greeter.vala
+++ b/src/arctica-greeter.vala
@@ -794,6 +794,8 @@ public class ArcticaGreeter
}
}
+ greeter.settings_daemon.stop();
+
if (nmapplet_pid != 0)
{
Posix.kill (nmapplet_pid, Posix.SIGTERM);
diff --git a/src/settings-daemon.vala b/src/settings-daemon.vala
index 6b06df8..523fa53 100644
--- a/src/settings-daemon.vala
+++ b/src/settings-daemon.vala
@@ -19,6 +19,7 @@
public class SettingsDaemon : Object
{
+ public int sd_pid = 0;
private int logind_inhibit_fd = -1;
private ScreenSaverInterface screen_saver;
private SessionManagerInterface session_manager;
@@ -132,6 +133,11 @@ public class SettingsDaemon : Object
}
}
+ public void stop ()
+ {
+ stop_settings_daemon();
+ }
+
private void set_plugin_enabled (string schema_name, bool enabled)
{
var source = SettingsSchemaSource.get_default ();
@@ -153,13 +159,37 @@ public class SettingsDaemon : Object
try
{
- Process.spawn_command_line_async (Config.SD_BINARY);
+ string[] argv;
+
+ Shell.parse_argv (Config.SD_BINARY, out argv);
+ Process.spawn_async (null,
+ argv,
+ null,
+ SpawnFlags.SEARCH_PATH,
+ null,
+ out sd_pid);
}
- catch (SpawnError e)
+ catch (Error e)
{
debug ("Could not start %s: %s", Config.SD_BINARY, e.message);
}
}
+
+ private void stop_settings_daemon ()
+ {
+ if (sd_pid != 0)
+ {
+ Posix.kill (sd_pid, Posix.SIGKILL);
+ int status;
+ Posix.waitpid (sd_pid, out status, 0);
+ if (Process.if_exited (status))
+ debug ("SettingsDaemon exited with return value %d", Process.exit_status (status));
+ else
+ debug ("SettingsDaemon terminated with signal %d", Process.term_sig (status));
+ sd_pid = 0;
+ }
+ }
+
}
[DBus (name="org.gnome.ScreenSaver")]