From 508f6a11d39860f4fdb005e8a54574a5fba52e9d Mon Sep 17 00:00:00 2001 From: Kazuhiro Inaba Date: Sat, 18 Jun 2011 00:10:36 -0400 Subject: [PATCH] Store capabilities when ibuscontext is not ready yet. Due to the asynchronous creation of contexts, gtk_im_set_use_preedit may be called before the context is ready. This patch is to record the change of capability flag and enables to set it later in _create_input_context_done. BUG=http://crosbug.com/16500 TEST=ChromeOS Cr-48 Review URL: http://codereview.appspot.com/4635049 Patch from Kazuhiro Inaba . --- client/gtk2/ibusimcontext.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c index a4e7a160..96369a77 100644 --- a/client/gtk2/ibusimcontext.c +++ b/client/gtk2/ibusimcontext.c @@ -934,13 +934,13 @@ ibus_im_context_set_use_preedit (GtkIMContext *context, gboolean use_preedit) IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); + if (use_preedit) { + ibusimcontext->caps |= IBUS_CAP_PREEDIT_TEXT; + } + else { + ibusimcontext->caps &= ~IBUS_CAP_PREEDIT_TEXT; + } if(ibusimcontext->ibuscontext) { - if (use_preedit) { - ibusimcontext->caps |= IBUS_CAP_PREEDIT_TEXT; - } - else { - ibusimcontext->caps &= ~IBUS_CAP_PREEDIT_TEXT; - } ibus_input_context_set_capabilities (ibusimcontext->ibuscontext, ibusimcontext->caps); } -- 2.34.1