Close ibus-xim when connection be closed.
authorHuang Peng <shawn.p.huang@gmail.com>
Wed, 6 Aug 2008 15:52:47 +0000 (23:52 +0800)
committerHuang Peng <shawn.p.huang@gmail.com>
Wed, 6 Aug 2008 15:52:47 +0000 (23:52 +0800)
x11/main.c

index 06e5977bcdaad054b5065b5320b27cb4d192c60d..9daaf30eea3074b51b3f55f59ae4a6923ddaad86 100644 (file)
@@ -536,6 +536,12 @@ _xim_event_destroy_cb (gpointer data)
 {
 }
 
+static void
+_xim_client_disconnected_cb (IBusIMClient *client, gpointer data)
+{
+       gtk_main_quit ();
+}
+
 static void
 _xim_init_IMdkit ()
 {
@@ -604,8 +610,15 @@ _xim_init_IMdkit ()
        ibus_im_context_register_type (NULL);
        _client = ibus_im_client_new ();
 
+       g_signal_connect (G_OBJECT (_client),
+               "disconnected",
+               G_CALLBACK (_xim_client_disconnected_cb),
+               NULL);
+
 }
 
+
+
 static void
 print_usage (FILE *fp, gchar *name)
 {