aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-05-17 14:25:55 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-05-17 14:25:55 +0200
commitc9f0793b67d2eea7f95f83211e4a9d729fbcc024 (patch)
tree6d31d871617f6d272a0eddf856f7f53417577eca /src
parent0916a5f7d09eb45937bf813e97ccf49edf18b766 (diff)
downloadarctica-greeter-c9f0793b67d2eea7f95f83211e4a9d729fbcc024.tar.gz
arctica-greeter-c9f0793b67d2eea7f95f83211e4a9d729fbcc024.tar.bz2
arctica-greeter-c9f0793b67d2eea7f95f83211e4a9d729fbcc024.zip
src/arctica-greeter.vala: Cleanly exit nm-applet when switching to the user context.
Diffstat (limited to 'src')
-rw-r--r--src/arctica-greeter.vala27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala
index 55b5b53..73d6650 100644
--- a/src/arctica-greeter.vala
+++ b/src/arctica-greeter.vala
@@ -654,6 +654,8 @@ public class ArcticaGreeter
string systemd_stderr;
int systemd_exitcode = 0;
+ Pid nmapplet_pid = 0;
+
var indicator_list = AGSettings.get_strv(AGSettings.KEY_INDICATORS);
var update_indicator_list = false;
@@ -725,12 +727,21 @@ public class ArcticaGreeter
try
{
- Process.spawn_command_line_async ("nm-applet");
+ string[] argv;
+
+ Shell.parse_argv ("nm-applet", out argv);
+ Process.spawn_async (null,
+ argv,
+ null,
+ SpawnFlags.SEARCH_PATH,
+ null,
+ out nmapplet_pid);
}
catch (Error e)
{
- warning ("Error starting nm-applet: %s", e.message);
+ warning ("Error starting the Network Manager Applet: %s", e.message);
}
+
}
else
greeter.show ();
@@ -781,6 +792,18 @@ public class ArcticaGreeter
}
}
+ if (nmapplet_pid != 0)
+ {
+ Posix.kill (nmapplet_pid, Posix.SIGTERM);
+ int status;
+ Posix.waitpid (nmapplet_pid, out status, 0);
+ if (Process.if_exited (status))
+ debug ("Network Manager Applet exited with return value %d", Process.exit_status (status));
+ else
+ debug ("Network Manager Applet terminated with signal %d", Process.term_sig (status));
+ atspi_pid = 0;
+ }
+
if (atspi_pid != 0)
{
Posix.kill (atspi_pid, Posix.SIGKILL);