JDK-6618401 : Input method cannot be selected from System menu
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u4,7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp,windows_vista
  • CPU: generic,x86
  • Submitted: 2007-10-18
  • Updated: 2014-10-24
  • Resolved: 2009-11-29
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.
JDK 7
7 b38Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
As far as I tried, this was reproducible only with java/awt/im/IMFTest and wasn't reproducible with Notepad demo.

Since jdk7-b15, IM-selection from System menu doesn't work on Windows and Solaris.

On Windows Vista, the list of InputMethods which can be selected is displayed correctly after "Select InputMethod" menu item in System menu is clicked. But you cannot choose any of them. Your choice will be ignored in IMFTest, irrespective of the InputMethod's type (native of Java).

On Solaris 10, the list of InuptMethods is NOT displayed even if you click "Select InputMethod" menu item. Instaed, a gray plain rectangle is displayed for a quick moment.

# How to reproduce
What I did were:
  - Copy two InputMedhod (CityIM.jar and CodePointIM.jar) to jre/lib/ext.
      (CityIM can be found in test directory, CodePoint IM in demo/jfc.)
  - Make some System-based InputMethods available.
  - Try to switch above InputMethods via "Select InputMethod" menu item in System menu.

Note: IM-switching from System's language bar/menu works correctly. Only IM-switching via System menu looks broken.
I contacted ###@###.###. The exact version of Solaris is 10 (x86). The window manager is CDE. He thinks that the problem on Solaris can be ignored because it appears only under Motif Look and Feel, which is not supported in JDK7.
Copied form the description of 6663665:
When input method selection popup appear, InputMethodDescriptor.getAvailableLocales() is being called repeadedly and sometimes interfere with user operation.
In order to reproduce,
place attaced WuBi.jar in jre/lib/ext.
lanunch Notepad demo.
from system menu click Select Input Method.
try to select wubi or Test input method.
You should notice following trace messages repeatedly output in console.

WuBi IM:getAvailableLocales() is being called.
Test IM:getAvailableLocales() is being called.

This doesn't happen (called once, not repeatedly many times) in 6u3.

Comments
WORK AROUND Don't use Input Method Menu from applets. Use it from applications.
02-07-2008

EVALUATION Thanks to ###@###.###, who found the solution. We should add lock.wait() in InputMethodManager.showInputMethodMenuOnRequesterEDT() exactly as it is in java.awt.EventQueue.invokeAndWait(). I tested the fix. It eliminates the problem.
26-06-2008

SUGGESTED FIX We should add lock.wait() in InputMethodManager.showInputMethodMenuOnRequesterEDT() exactly as it is in java.awt.EventQueue.invokeAndWait(). ---------- src/share/classes/sun/awt/im/InputMethodManager.java @@ -356,10 +356,11 @@ true); AppContext requesterAppContext = SunToolkit.targetToAppContext(requester); synchronized (lock) { SunToolkit.postEvent(requesterAppContext, event); + lock.wait(); } Throwable eventThrowable = event.getThrowable(); if (eventThrowable != null) { throw new InvocationTargetException(eventThrowable); -------------
26-06-2008

EVALUATION It seems the bug is reproducible in applets only. If you start SwingSet2 demo as an application, you will be able to select input methods. However, if you start SwingSet2 demo as an applet in AppletViewer, you won't be able to change input methods. I can reproduce the bug in Windows XP.
25-06-2008

SUGGESTED FIX This looks like a regression of one of the recent popup fixes
30-05-2008

EVALUATION The issue is a regression of the fix for 6544309. After the fix the showInputMethodMenu method is called on the correct EDT and the sun.awt.im.InputMethodManager.showInputMethodMenuOnRequesterEDT method includes this code introduced by the fix: InvocationEvent event = new InvocationEvent(requester, new Runnable() { public void run() { showInputMethodMenu(); } }, lock, true); AppContext requesterAppContext = SunToolkit.targetToAppContext(requester); synchronized (lock) { SunToolkit.postEvent(requesterAppContext, event); } Note that there is no lock.wait() call after postEvent(...) call. It doesn't wait until the runnable has finished and the same invocation events are posted to the EDT. Reassign to Swing team.
23-05-2008