diff options
author | Huang Peng <shawn.p.huang@gmail.com> | 2009-02-28 19:08:12 +0800 |
---|---|---|
committer | Huang Peng <shawn.p.huang@gmail.com> | 2009-02-28 19:08:12 +0800 |
commit | c28cb8a517b8edb835b5d4b37c914ce6b93e39bd (patch) | |
tree | 7df2ecb953e08baa43d5a25b411dd604ae19c63a | |
parent | 0b8d0067b475aade2bf5f8de7db5dd47d8a59b5e (diff) | |
download | ibus-c28cb8a517b8edb835b5d4b37c914ce6b93e39bd.tar.gz ibus-c28cb8a517b8edb835b5d4b37c914ce6b93e39bd.tar.xz ibus-c28cb8a517b8edb835b5d4b37c914ce6b93e39bd.zip |
Clear preedit when input context is disabled.
-rw-r--r-- | client/gtk2/ibusimcontext.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c index f622de1..60f8576 100644 --- a/client/gtk2/ibusimcontext.c +++ b/client/gtk2/ibusimcontext.c @@ -694,6 +694,7 @@ _ibus_context_enabled_cb (IBusInputContext *ibus_context, IBusIMContextPrivate *priv = context->priv; priv->enable = TRUE; + g_signal_emit (context, _signal_preedit_changed_id, 0); } static void @@ -704,6 +705,14 @@ _ibus_context_disabled_cb (IBusInputContext *ibus_context, IBusIMContextPrivate *priv = context->priv; priv->enable = FALSE; + + /* clear preedit */ + priv->preedit_visible = FALSE; + priv->preedit_cursor_pos = 0; + g_free (priv->preedit_string); + priv->preedit_string = NULL; + + g_signal_emit (context, _signal_preedit_changed_id, 0); } static void |