From 8166b0b98bfe0d70c03fa26bb5e721a357ad4ef8 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Tue, 11 Sep 2012 11:21:58 -0400 Subject: [PATCH] Use gdk_threads_add_idle_full() in gtkimmodule to avoid race condition in some multi-threaded apps. BUG=http://code.google.com/p/ibus/issues/detail?id=1505 Review URL: https://codereview.appspot.com/6488104 --- client/gtk2/ibusimcontext.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c index 584b92d..cb5561b 100644 --- a/client/gtk2/ibusimcontext.c +++ b/client/gtk2/ibusimcontext.c @@ -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) */ -- 2.7.4