summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-09-15 10:53:49 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-09-15 10:53:49 +0800
commitf5c66bd6ac878f3b00c5117eb0e696b351439ee4 (patch)
tree6a7212ee9f510556a1f4b58e2f182ea738986cf2 /client
parent8d5a013a8a1f66f5071d2ebbfce78ed433fb2872 (diff)
downloadibus-f5c66bd6ac878f3b00c5117eb0e696b351439ee4.tar.gz
ibus-f5c66bd6ac878f3b00c5117eb0e696b351439ee4.tar.xz
ibus-f5c66bd6ac878f3b00c5117eb0e696b351439ee4.zip
Workaround for increase search for treeview.
Diffstat (limited to 'client')
-rw-r--r--client/gtk2/ibusimcontext.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
index 1f663aa..c97689b 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
@@ -108,7 +108,6 @@ static GtkIMContextClass *parent_class = NULL;
static IBusIMClient *_client = NULL;
static GHashTable *_ic_table = NULL;
static GArray *_im_context_array = NULL;
-static gboolean _block_filter_key_event = FALSE;
void
ibus_im_context_register_type (GTypeModule *type_module)
@@ -125,16 +124,6 @@ ibus_im_context_register_type (GTypeModule *type_module)
(GInstanceInitFunc) ibus_im_context_init,
};
- /* work around for nautilus */
-#if GLIB_CHECK_VERSION (2, 18, 0)
- gchar *nautilus_name = g_dgettext("nautilus", "File Manager");
-#else
- gchar *nautilus_name = dgettext("nautilus", "File Manager");
-#endif
- if (g_strcmp0(g_get_application_name (), nautilus_name) == 0) {
- _block_filter_key_event = TRUE;
- }
-
if (! _ibus_type_im_context ) {
if (type_module) {
_ibus_type_im_context =
@@ -317,10 +306,17 @@ ibus_im_context_filter_keypress (GtkIMContext *context,
IBusIMContext *ibus = IBUS_IM_CONTEXT (context);
IBusIMContextPrivate *priv = ibus->priv;
- if (priv->ic &&
- ibus_im_client_filter_keypress (_client,
- priv->ic, event, _block_filter_key_event))
- return TRUE;
+ if (priv->ic) {
+ /* If context does not have focus, ibus will process key event in sync mode.
+ * It is a workaround for increase search in treeview.
+ */
+ gboolean retval = ibus_im_client_filter_keypress (_client,
+ priv->ic, event,
+ priv->has_focus == FALSE);
+ if (retval)
+ return TRUE;
+ return gtk_im_context_filter_keypress (priv->slave, event);
+ }
else
return gtk_im_context_filter_keypress (priv->slave, event);
}