diff options
| author | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-19 22:05:49 +0800 |
|---|---|---|
| committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-19 22:05:49 +0800 |
| commit | 26097461cb2428f7c594c11fd12123705bbbbc39 (patch) | |
| tree | 5ebdd1e53694234590767c9d40d17eba1f37092e /client | |
| parent | 628a3d8eea5bb38beae3022cf594212e803f0d22 (diff) | |
| download | ibus-26097461cb2428f7c594c11fd12123705bbbbc39.tar.gz ibus-26097461cb2428f7c594c11fd12123705bbbbc39.tar.xz ibus-26097461cb2428f7c594c11fd12123705bbbbc39.zip | |
Add code to work around bug http://code.google.com/p/ibus/issues/detail?id=25.
Diffstat (limited to 'client')
| -rw-r--r-- | client/gtk2/ibusimcontext.c | 19 | ||||
| -rw-r--r-- | client/x11/main.c | 2 |
2 files changed, 13 insertions, 8 deletions
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c index 617e407..e6787f1 100644 --- a/client/gtk2/ibusimcontext.c +++ b/client/gtk2/ibusimcontext.c @@ -25,7 +25,6 @@ #include <sys/un.h> #include "ibusimcontext.h" #include "ibusimclient.h" - /* IBusIMContextPriv */ struct _IBusIMContextPrivate { GtkIMContext *slave; @@ -101,6 +100,7 @@ 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) @@ -117,6 +117,11 @@ ibus_im_context_register_type (GTypeModule *type_module) (GInstanceInitFunc) ibus_im_context_init, }; + /* work around for nautilus */ + if (g_strcmp0(g_get_application_name (), "File Manager") == 0) { + _block_filter_key_event = TRUE; + } + if (! _ibus_type_im_context ) { if (type_module) { _ibus_type_im_context = @@ -151,7 +156,6 @@ GtkIMContext * ibus_im_context_new (void) { IBusIMContext *obj; - obj = IBUS_IM_CONTEXT(g_object_new (IBUS_TYPE_IM_CONTEXT, NULL)); return GTK_IM_CONTEXT(obj); @@ -276,7 +280,8 @@ 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)) + + if (priv->ic && ibus_im_client_filter_keypress (_client, priv->ic, event, _block_filter_key_event)) return TRUE; else return gtk_im_context_filter_keypress (priv->slave, event); @@ -475,10 +480,10 @@ _client_forward_event_cb (IBusIMClient *client, const gchar *ic, GdkEvent *event g_get_current_time (&time); event->key.time = time.tv_sec * 1000 + time.tv_usec / 1000; } - if (event->any.window == NULL) { - event->any.window = context->priv->client_window; - gdk_event_put (event); - event->any.window = NULL; + if (event->any.window != context->priv->client_window) { + GdkEvent _event = *event; + _event.any.window = context->priv->client_window; + gdk_event_put (&_event); } else gdk_event_put (event); diff --git a/client/x11/main.c b/client/x11/main.c index f2198dc..8a1c150 100644 --- a/client/x11/main.c +++ b/client/x11/main.c @@ -281,7 +281,7 @@ xim_forward_event (XIMS xims, IMForwardEventStruct *call_data) event.send_event = xevent->send_event; event.window = NULL; - if (ibus_im_client_filter_keypress (_client, x11ic->ibus_ic, &event)) { + if (ibus_im_client_filter_keypress (_client, x11ic->ibus_ic, &event, False)) { if (! x11ic->has_preedit_area) _xim_set_cursor_location (x11ic); return 1; |
