From: Peng Huang Date: Tue, 11 Sep 2012 15:21:58 +0000 (-0400) Subject: Use gdk_threads_add_idle_full() in gtkimmodule to avoid race condition in some multi... X-Git-Tag: 1.4.99.20121006~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8166b0b98bfe0d70c03fa26bb5e721a357ad4ef8;p=platform%2Fupstream%2Fibus.git 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 --- 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) */