aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
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 */