diff options
author | Anton Tarasov <anton.tarasov@jetbrains.com> | 2018-10-12 14:32:33 +0300 |
---|---|---|
committer | Anton Tarasov <anton.tarasov@jetbrains.com> | 2018-10-12 14:34:30 +0300 |
commit | 2d7c29b0abab252167399fb41eb04689d3a4f2f6 (patch) | |
tree | 7d4f61d07cca9d7105ab629d240f0378a1c449df | |
parent | eaf8464f7b1cbf60645e3218f0298563c5a1bd82 (diff) | |
download | jdk8u_jdk-2d7c29b0abab252167399fb41eb04689d3a4f2f6.tar.gz |
JRE-981 IM workaround does not work anymore
-rw-r--r-- | src/macosx/classes/sun/lwawt/macosx/CInputMethod.java | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java b/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java index 7842e0fdea..be127c2d5f 100644 --- a/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java +++ b/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java @@ -376,14 +376,6 @@ public class CInputMethod extends InputMethodAdapter { fAwtFocussedComponentPeer = null; } - private boolean isValid() { - return fIMContext != null && - fAwtFocussedComponent != null && - fAwtFocussedComponentPeer != null && - fCurrentText != null && - fCurrentTextAsString != null; - } - /** * Returns a control object from this input method, or null. A * control object provides methods that control the behavior of the @@ -603,7 +595,7 @@ public class CInputMethod extends InputMethodAdapter { final String[] retString = new String[] {""}; try { - if (isValid()) + if (fIMContext != null) LWCToolkit.invokeAndWait(new Runnable() { public void run() { synchronized(retString) { int location = locationIn; @@ -656,7 +648,7 @@ public class CInputMethod extends InputMethodAdapter { final int[] returnValue = new int[2]; try { - if (isValid()) + if (fIMContext != null) LWCToolkit.invokeAndWait(new Runnable() { public void run() { synchronized(returnValue) { AttributedCharacterIterator theIterator = fIMContext.getSelectedText(null); @@ -732,7 +724,7 @@ public class CInputMethod extends InputMethodAdapter { final int[] rect = new int[4]; try { - if (isValid()) + if (fIMContext != null) LWCToolkit.invokeAndWait(new Runnable() { public void run() { synchronized(rect) { int insertOffset = fIMContext.getInsertPositionOffset(); @@ -751,7 +743,7 @@ public class CInputMethod extends InputMethodAdapter { if (composedTextOffset > 0 && (fAwtFocussedComponent instanceof JTextComponent)) { Rectangle r2 = fIMContext.getTextLocation(TextHitInfo.beforeOffset(0)); - if (r.equals(r2)) { + if (r.equals(r2) && fCurrentTextAsString != null) { // FIXME: (SAK) If the candidate text wraps over two lines, this calculation pushes the candidate // window off the right edge of the component. String inProgressSubstring = fCurrentTextAsString.substring(0, composedTextOffset); @@ -777,7 +769,7 @@ public class CInputMethod extends InputMethodAdapter { final int[] insertPositionOffset = new int[1]; try { - if (isValid()) + if (fIMContext != null) LWCToolkit.invokeAndWait(new Runnable() { public void run() { synchronized(offsetInfo) { offsetInfo[0] = fIMContext.getLocationOffset(screenX, screenY); |