6707023: Chenese Characters in JTextPane Cause Pane to Hang

Input method events are dispatched to correct AppContext

Reviewed-by: naoto, yan
This commit is contained in:
Artem Ananiev 2008-09-01 17:41:45 +04:00
parent 4bdcbbe0b6
commit 003c0aae4a

View File

@ -548,11 +548,15 @@ public class WInputMethod extends InputMethodAdapter
public void inquireCandidatePosition() public void inquireCandidatePosition()
{ {
Component source = getClientComponent();
if (source == null) {
return;
}
// This call should return immediately just to cause // This call should return immediately just to cause
// InputMethodRequests.getTextLocation be called within // InputMethodRequests.getTextLocation be called within
// AWT Event thread. Otherwise, a potential deadlock // AWT Event thread. Otherwise, a potential deadlock
// could happen. // could happen.
java.awt.EventQueue.invokeLater(new Runnable() { Runnable r = new Runnable() {
public void run() { public void run() {
int x = 0; int x = 0;
int y = 0; int y = 0;
@ -573,7 +577,9 @@ public class WInputMethod extends InputMethodAdapter
openCandidateWindow(awtFocussedComponentPeer, x, y); openCandidateWindow(awtFocussedComponentPeer, x, y);
} }
}); };
WToolkit.postEvent(WToolkit.targetToAppContext(source),
new InvocationEvent(source, r));
} }
// java.awt.Toolkit#getNativeContainer() is not available // java.awt.Toolkit#getNativeContainer() is not available