summaryrefslogtreecommitdiffstats
path: root/lib/gtk2
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-08-19 22:05:49 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-08-19 22:05:49 +0800
commit26097461cb2428f7c594c11fd12123705bbbbc39 (patch)
tree5ebdd1e53694234590767c9d40d17eba1f37092e /lib/gtk2
parent628a3d8eea5bb38beae3022cf594212e803f0d22 (diff)
downloadibus-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 'lib/gtk2')
-rw-r--r--lib/gtk2/ibusimclient.c43
-rw-r--r--lib/gtk2/ibusimclient.h3
2 files changed, 32 insertions, 14 deletions
diff --git a/lib/gtk2/ibusimclient.c b/lib/gtk2/ibusimclient.c
index fef0c42..e7b117e 100644
--- a/lib/gtk2/ibusimclient.c
+++ b/lib/gtk2/ibusimclient.c
@@ -631,7 +631,7 @@ ibus_im_client_release_input_context (IBusIMClient *client, const gchar *ic)
gboolean
-ibus_im_client_filter_keypress (IBusIMClient *client, const gchar *ic, GdkEventKey *event)
+ibus_im_client_filter_keypress (IBusIMClient *client, const gchar *ic, GdkEventKey *event, gboolean block)
{
g_return_val_if_fail (IBUS_IS_IM_CLIENT(client), FALSE);
g_return_val_if_fail (ic != NULL, FALSE);
@@ -647,19 +647,36 @@ ibus_im_client_filter_keypress (IBusIMClient *client, const gchar *ic, GdkEventK
}
/* Call IBus ProcessKeyEvent method */
- if (!_ibus_call_with_reply (priv->ibus,
- "ProcessKeyEvent",
- _ibus_filter_keypress_reply_cb,
- _key_press_call_data_new (client, ic, (GdkEvent *)event),
- (DBusFreeFunction)_key_press_call_data_free,
- DBUS_TYPE_STRING, &ic,
- DBUS_TYPE_UINT32, &event->keyval,
- DBUS_TYPE_BOOLEAN, &is_press,
- DBUS_TYPE_UINT32, &state,
- DBUS_TYPE_INVALID))
- return FALSE;
+ if (!block) {
+ if (!_ibus_call_with_reply (priv->ibus,
+ "ProcessKeyEvent",
+ _ibus_filter_keypress_reply_cb,
+ _key_press_call_data_new (client, ic, (GdkEvent *)event),
+ (DBusFreeFunction)_key_press_call_data_free,
+ DBUS_TYPE_STRING, &ic,
+ DBUS_TYPE_UINT32, &event->keyval,
+ DBUS_TYPE_BOOLEAN, &is_press,
+ DBUS_TYPE_UINT32, &state,
+ DBUS_TYPE_INVALID))
+ return FALSE;
+ else
+ return TRUE;
+ }
+ else {
+ gboolean result = FALSE;
+ if (!_ibus_call_with_reply_and_block (priv->ibus,
+ "ProcessKeyEvent",
+ DBUS_TYPE_STRING, &ic,
+ DBUS_TYPE_UINT32, &event->keyval,
+ DBUS_TYPE_BOOLEAN, &is_press,
+ DBUS_TYPE_UINT32, &state,
+ DBUS_TYPE_INVALID,
+ DBUS_TYPE_BOOLEAN, &result,
+ DBUS_TYPE_INVALID))
+ return FALSE;
- return TRUE;
+ return result;
+ }
}
diff --git a/lib/gtk2/ibusimclient.h b/lib/gtk2/ibusimclient.h
index d88302e..49067d9 100644
--- a/lib/gtk2/ibusimclient.h
+++ b/lib/gtk2/ibusimclient.h
@@ -102,7 +102,8 @@ void ibus_im_client_reset (IBusIMClient *client,
const gchar *ic);
gboolean ibus_im_client_filter_keypress (IBusIMClient *client,
const gchar *ic,
- GdkEventKey *key);
+ GdkEventKey *key,
+ gboolean block);
void ibus_im_client_set_cursor_location
(IBusIMClient *client,
const gchar *ic,