aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-04-18 11:13:03 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-04-18 11:13:03 -0500
commit67218e58889b101ceb5a50bcb40c37045fb2855d (patch)
treeba37f8f02116e8b2aefa23bf2be0509d53367e6a /src/main.c
parentd79745bdb2e9bbd02e162a5209de9f227d1dbbc3 (diff)
downloadayatana-indicator-session-67218e58889b101ceb5a50bcb40c37045fb2855d.tar.gz
ayatana-indicator-session-67218e58889b101ceb5a50bcb40c37045fb2855d.tar.bz2
ayatana-indicator-session-67218e58889b101ceb5a50bcb40c37045fb2855d.zip
indicator-session-service should exit when it loses ownership of its name on the bus.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 17b50b4..4511fce 100644
--- a/src/main.c
+++ b/src/main.c
@@ -60,6 +60,13 @@ parse_command_line (int * argc, char *** argv)
****
***/
+static void
+on_name_lost (gpointer instance, gpointer loop)
+{
+ g_debug ("exiting: service couldn't acquire or lost ownership of busname");
+ g_main_loop_quit ((GMainLoop*)loop);
+}
+
int
main (int argc, char ** argv)
{
@@ -76,6 +83,8 @@ main (int argc, char ** argv)
/* run */
service = indicator_session_service_new (replace);
loop = g_main_loop_new (NULL, FALSE);
+ g_signal_connect (service, INDICATOR_SESSION_SERVICE_SIGNAL_NAME_LOST,
+ G_CALLBACK(on_name_lost), loop);
g_main_loop_run (loop);
/* cleanup */