6707023: Chenese Characters in JTextPane Cause Pane to Hang
authorart
Mon, 01 Sep 2008 17:41:45 +0400
changeset 1956 c22d63290cb1
parent 1955 e4f3afbad6e9
child 1958 f219439dfa85
6707023: Chenese Characters in JTextPane Cause Pane to Hang Summary: input method events are dispatched to correct AppContext Reviewed-by: naoto, yan
jdk/src/windows/classes/sun/awt/windows/WInputMethod.java
--- a/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java	Tue Aug 26 16:31:13 2008 +0400
+++ b/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java	Mon Sep 01 17:41:45 2008 +0400
@@ -548,11 +548,15 @@
 
     public void inquireCandidatePosition()
     {
+        Component source = getClientComponent();
+        if (source == null) {
+            return;
+        }
         // This call should return immediately just to cause
         // InputMethodRequests.getTextLocation be called within
         // AWT Event thread.  Otherwise, a potential deadlock
         // could happen.
-        java.awt.EventQueue.invokeLater(new Runnable() {
+        Runnable r = new Runnable() {
             public void run() {
                 int x = 0;
                 int y = 0;
@@ -573,7 +577,9 @@
 
                 openCandidateWindow(awtFocussedComponentPeer, x, y);
             }
-        });
+        };
+        WToolkit.postEvent(WToolkit.targetToAppContext(source),
+                           new InvocationEvent(source, r));
     }
 
     // java.awt.Toolkit#getNativeContainer() is not available