bus: Own a name on the DBus session bus
authorRui Matos <tiagomatos@gmail.com>
Thu, 12 Jul 2012 15:11:23 +0000 (11:11 -0400)
committerPeng Huang <shawn.p.huang@gmail.com>
Thu, 12 Jul 2012 15:11:23 +0000 (11:11 -0400)
This makes it easier for third parties to track the ibus-daemon life
cycle.

BUG=http://code.google.com/p/ibus/issues/detail?id=1476
TEST=

Review URL: https://codereview.appspot.com/6374058
Patch from Rui Matos <tiagomatos@gmail.com>.

bus/server.c

index ed38460..253b6c3 100644 (file)
@@ -122,6 +122,10 @@ bus_server_init (void)
 
     /* write address to file */
     ibus_write_address (address);
+
+    /* own a session bus name so that third parties can easily track our life-cycle */
+    g_bus_own_name (G_BUS_TYPE_SESSION, IBUS_SERVICE_IBUS, G_BUS_NAME_OWNER_FLAGS_NONE,
+                    NULL, NULL, NULL, NULL, NULL);
 }
 
 const gchar *