(For those how is unfamiliar with XEmbed, see http://www.freedesktop.org/wiki/standards/xembed-spec) Use the attached GTK XEmbed test. To run it, start ./gtk-embedder, then click on "Add Active GTK+ Child", the child with text field will appear. Try to input some text into it using different techniques, enable/disable IM - nothing helps, you can't inputanything. The only way I found is to click by right mouse button when IM is enabled(put focus back into embedder's textfield, press Ctrl-space, then click into client's text field), then the window with on-screen keyboard appears, and I am able to input English letters. Similarly to GTK, Java 1.5.0 based applets are unable to receive any input in the locales XIM is enabled, when they are run in the version of Mozilla with XEmbed enabled plugins.
Created attachment 1457 [details] test case gtk-embedder ang gtk-client
A suspecious code is found in xc/lib/X11/imEvToWire.c. At line 408: if (((XAnyEvent *)re)->send_event) event->u.u.type &= 0x80; This converts the X events with send_event bit ON to the wired events with uu.type = 0. Since the events that Xembedder sends to embedded clients have the send_event bit ON, it hits this case. As the results, the wired events sent to the XIM server are converted back to x events with type 0(zero), and will not be processed properly. I think the above must be a typo and that it should be: event->u.u.type |= 0x80;
Uhm... I doubt Xlib/Xft is the right component... isn't this XIM related ?
Yes, Lib/Xlib is a right category. The patch should be applied to xc/lib/X11/imEvToWire.c.
Created attachment 2031 [details] [review] correct mask of the xevents of send_event masks &= 0x80 operation is obviously wrong, since it resets event type field to 0, This is most likely a typo of |= 0x80.
Roland and Alan: Please review the patch and commit for me to the cvs HEAD if it looks good.
Patch makes sense to me, so I went ahead and committed it to head: CVSROOT: /cvs/xorg Module name: xc Changes by: alanc@gabe.freedesktop.org 05/03/07 18:53:36 Log message: 2005-03-07 Alan Coopersmith <alan.coopersmith@sun.com> * xc/lib/X11/imEvToWire.c: Bugzilla Bug 2006 (https://bugs.freedesktop.org/show_bug.cgi?id=2006) Patch #2031 (https://bugs.freedesktop.org/attachment.cgi?id=2031) XEmbed client doesn't receive key events from XIM: Use | to set a bit, not &. Patch by Hidetoshi Tajima <hidetoshi.tajima@sun.com>. Modified files: ./: ChangeLog xc/lib/X11/: imEvToWire.c Revision Changes Path 1.803 +9 -1 xc/ChangeLog 1.3 +1 -1 xc/lib/X11/imEvToWire.c
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.