Use gdk_threads_add_idle_full() in gtkimmodule to avoid race condition in some multi...
authorPeng Huang <shawn.p.huang@gmail.com>
Tue, 11 Sep 2012 15:21:58 +0000 (11:21 -0400)
committerPeng Huang <shawn.p.huang@gmail.com>
Tue, 11 Sep 2012 15:21:58 +0000 (11:21 -0400)
BUG=http://code.google.com/p/ibus/issues/detail?id=1505

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

client/gtk2/ibusimcontext.c

index 584b92d..cb5561b 100644 (file)
@@ -769,10 +769,10 @@ ibus_im_context_focus_in (GtkIMContext *context)
 
     /* set_cursor_location_internal() will get origin from X server,
      * it blocks UI. So delay it to idle callback. */
-    g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
-                     (GSourceFunc) _set_cursor_location_internal,
-                     g_object_ref (ibusimcontext),
-                     (GDestroyNotify) g_object_unref);
+    gdk_threads_add_idle_full (G_PRIORITY_DEFAULT_IDLE,
+                               (GSourceFunc) _set_cursor_location_internal,
+                               g_object_ref (ibusimcontext),
+                               (GDestroyNotify) g_object_unref);
 
     /* retrieve the initial surrounding-text (regardless of whether
      * the current IBus engine needs surrounding-text) */