From fb0ee5e854f9eb1ae1ae879c29072dbe295fac6a Mon Sep 17 00:00:00 2001 From: art Date: Mon, 1 Sep 2008 17:41:45 +0400 Subject: [PATCH] 6707023: Chenese Characters in JTextPane Cause Pane to Hang Summary: input method events are dispatched to correct AppContext Reviewed-by: naoto, yan --- src/windows/classes/sun/awt/windows/WInputMethod.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/windows/classes/sun/awt/windows/WInputMethod.java b/src/windows/classes/sun/awt/windows/WInputMethod.java index 33be7f8b4..6cec225db 100644 --- a/src/windows/classes/sun/awt/windows/WInputMethod.java +++ b/src/windows/classes/sun/awt/windows/WInputMethod.java @@ -548,11 +548,15 @@ public class WInputMethod extends InputMethodAdapter 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 @@ public class WInputMethod extends InputMethodAdapter openCandidateWindow(awtFocussedComponentPeer, x, y); } - }); + }; + WToolkit.postEvent(WToolkit.targetToAppContext(source), + new InvocationEvent(source, r)); } // java.awt.Toolkit#getNativeContainer() is not available -- GitLab