JBR-3291 Input of characters using Alt+<NumPad> stopped working on Windows

(cherry picked from commit ba6b9c085e)
This commit is contained in:
Dmitry Batrak
2021-04-12 16:30:38 +03:00
committed by alexey.ushakov@jetbrains.com
parent 17233c2efc
commit 28730d2071

View File

@@ -79,7 +79,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
private LinkedList<TypeAheadMarker> typeAheadMarkers = new LinkedList<TypeAheadMarker>();
private boolean consumeNextKeyTyped;
private Component restoreFocusTo;
private Component keyPressedComponent;
private WeakReference<Component> lastKeyPressedOrReleasedTarget = NULL_COMPONENT_WR;
private static boolean fxAppThreadIsDispatchThread;
@@ -1097,19 +1097,15 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
if (((AWTEvent) ke).isPosted) {
Component focusOwner;
if (ke.getID() == KeyEvent.KEY_TYPED) {
focusOwner = keyPressedComponent;
focusOwner = lastKeyPressedOrReleasedTarget.get();
} else {
focusOwner = getFocusOwner();
if (focusOwner == null) {
focusOwner = getFocusedWindow();
}
lastKeyPressedOrReleasedTarget = new WeakReference<>(focusOwner);
}
ke.setSource(focusOwner);
if (ke.getID() == KeyEvent.KEY_PRESSED) {
keyPressedComponent = focusOwner;
} else if (ke.getID() == KeyEvent.KEY_RELEASED) {
keyPressedComponent = null;
}
}
if (ke.getSource() == null) {
return true;