[Fedora-i18n-bugs] [Bug 677856] When using x input method in gtk3 application, hangul input is broken.

bugzilla at redhat.com bugzilla at redhat.com
Wed Mar 9 06:41:12 UTC 2011


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.


https://bugzilla.redhat.com/show_bug.cgi?id=677856

--- Comment #7 from fujiwara <tfujiwar at redhat.com> 2011-03-09 01:41:11 EST ---
There are two problems.
One is that snooper was not removed when the im client is switched from ibus to
xim and it was fixed in ibus-1.3.99.20110206-4.fc15.

Another is that ibus-x11 doesn't receive KeyPress events because KeyRelease
events are buffered in X11.
If the im client is gtk-xim, the gtk_im_context_xim_filter_keypress() calls
XFilterEvent() and XFilterEvent() calls XSendEvent() internally.
ibus-x11 receives the key event from XFilterEvent() -> WaitXIMProtocol() ->
xim_forward_event().

ibus_hangul_engine_process_key_event returns FALSE in KeyRelease.
If the process_key_events returns FALSE, xim_forward_event() sends the same
event again with XIM_FORWARD_EVENT.
It seems gdk does not pick up the forwarded KeyRelease events with
XFilterEvent() in _gdk_x11_display_queue_events().
So if you type the next chars, the events are not KeyPress but the buffered
KeyRelease. 
XFilterEvent() always returns FALSE for the buffered events in
_XimProtoKeypressFilter().
So gtk-xim outputs the ASCII chars but not the chars from ibus-hangul.
XIM_FORWARD_EVENT has the option of sync_bit but it seems it's not handled
correctly at present.

The possible solution is to ignore the KeyRelease event for gtk-xim.
--- ibus/client/x11/main.c
+++ ibus/client/x11/main.c
@@ -654,7 +654,7 @@ xim_get_ic_values (XIMS xims, IMChangeIC
     for (i = 0; i < (int) call_data->ic_attr_num; ++i, ++ic_attr) {
         if (g_strcmp0 (XNFilterEvents, ic_attr->name) == 0) {
             ic_attr->value = (void *) malloc (sizeof (CARD32));
-            *(CARD32 *) ic_attr->value = KeyPressMask | KeyReleaseMask;
+            *(CARD32 *) ic_attr->value = KeyPressMask;
             ic_attr->value_length = sizeof (CARD32);
         }
     }

I'll talk with the maintainer.

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the i18n-bugs mailing list