Fix no output when ibus-daemon is running on another display.
authorfujiwarat <takao.fujiwara1@gmail.com>
Fri, 20 Sep 2013 01:58:34 +0000 (10:58 +0900)
committerfujiwarat <takao.fujiwara1@gmail.com>
Fri, 20 Sep 2013 01:58:34 +0000 (10:58 +0900)
Using ssh -X or another display, the hostname and display numbers
can be different between the GTK clients and ibus-daemon.
This patch fixes the output:
"Events queue growing too big, will start to drop."

BUG=RH#1004135
TEST=clients/gtk*/im-ibus.so

Review URL: https://codereview.appspot.com/13707046

client/gtk2/ibusimcontext.c

index b6fe2c0..eef062c 100644 (file)
@@ -492,7 +492,13 @@ daemon_name_appeared (GDBusConnection *connection,
                       const gchar     *owner,
                       gpointer         data)
 {
-    _daemon_is_running = TRUE;
+    /* If ibus-daemon is running and run ssh -X localhost,
+     * daemon_name_appeared() is called but ibus_get_address() == NULL
+     * because the hostname and display number are different between
+     * ibus-daemon and clients. So IBusBus would not be connected and
+     * ibusimcontext->ibuscontext == NULL and ibusimcontext->events_queue
+     * could go beyond MAX_QUEUED_EVENTS . */
+    _daemon_is_running = (ibus_get_address () != NULL);
 }
 
 static void