JDK-4196573 : XIM cannot filter X events other than XKey* events from Java text AWT
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt:i18n
  • Affected Version: 1.2.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_7
  • CPU: generic
  • Submitted: 1998-12-10
  • Updated: 1999-01-30
  • Resolved: 1999-01-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.2.2 1.2.2Fixed
Related Reports
Relates :  
Description
On solaris platform, XIM cannot filter ButtonPress, ButtonRelease, MotionNotify,
or Expose events from java awt textfield or textarea widgets.

This is necessary for input method for some European locales of Solaris7,
including ru(Russain) and en_US.UTF-8, where input method is located
locally in Xlibrary and a single xevent dispatch loop is shared between the
application and the Xlibrary. Unless these events are filtered, the input
method cannot display the status area, nor cannot use mouse at all
to select a choice on lookup choice window.

To reproduce the problem, build a sample java.awt.textarea application
attached, and run it in en_US.UTF-8 locale of Solaris2.6 or 7.
No text appears in the status area, while it shows something like
"[English/European]"  in it with any Motif text widget application.

This is because no Xexpose events is sent from java awt to XtDispatchEvent.







Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.2.2 FIXED IN: 1.2.2 INTEGRATED IN: 1.2.2
14-06-2004

WORK AROUND No useful and very safe workaround.
11-06-2004

EVALUATION Please investigate whether we can support these peculiar requirements without major changes to the AWT event handling. norbert.lindenberg@Eng 1998-12-11 Change is one line in awt_MToolkit.c. Very low risk. fred.oliver@East 1999-01-19 awt_MToolkit.c's processOneEvent() does not call XtDispatchEvent() to dispatch the event if the target is "widget == 0" or "!XtIsObject()" or "widget->core.being_destroyed", which is to fix jdk11x bug #4041235 and #4100167. In JDK1.2, we are supposed to have check for "core.being_destroyed" at all event handling places in peer's native code, so the race problem should be gone, and it may be safe to add the suggested fix into processOneEvent to solve this IM problem (Solaris IM expert says it's the only way to solve the problem), at least I am not able to reproduce these two crash bugs in JDK1.2 with the suggested fix. But I would like to let the awt team to evaluate it again and make the final decision. xueming.shen@Japan 1999-01-28 There were some confusion with XFilterEvent and XtDispatchEvent. After further review, we came to the conclusion that there is no problem with the suggested fix which will be integrated into 1.2.2. masayoshi.okutsu@Eng 1999-01-28
28-01-1999

SUGGESTED FIX Not only XKey*Events, but pass any type of Xevents to XtDispatchEvent which has not been consumed by java awt. I'm not sure how much risky it is, but adding just one line in awt_MToolkit.c to call XFilterEvent() will fix the problem. The change is to give X Input Method in libX11 a chance to filter those X events which are not for java awt components to process, but for the X Input Method. It is very safe change, since it won't affect anything on java awt event dispatching/processing mechanism. Please review the change and evaluate the bug again. ------- awt_MToolkit.c ------- *** /tmp/dlHayUT Fri Jan 15 18:26:39 1999 --- awt_MToolkit.c Fri Jan 15 18:26:30 1999 *************** *** 794,799 **** --- 794,806 ---- (widget->core.being_destroyed)) { /* There is no longer a widget for this event. Skip it. */ XNextEvent(awt_display, &xev); + + /* Call XFilterEvent() to give a chance to X Input Method + to process this event before being discarded. + Fix for BugTraq ID 4196573: XIM cannot filter X events + other than XKey* events from Java text AWT + */ + XFilterEvent(&xev, NULL); return; } [hidetoshi.tajima@Eng 1999-01-15]
15-01-1999