mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-10 06:59:05 +00:00
8015454: java/awt/Focus/TypeAhead/TestFocusFreeze.java hangs with jdk8 since b56
Reviewed-by: anthony
This commit is contained in:
parent
3352552f34
commit
861f05be2f
@ -285,10 +285,17 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
|
||||
TimedWindowEvent we = (TimedWindowEvent)e;
|
||||
long time = we.getWhen();
|
||||
synchronized (this) {
|
||||
for (KeyEvent ke: enqueuedKeyEvents) {
|
||||
if (time >= ke.getWhen()) {
|
||||
SunToolkit.postEvent(AppContext.getAppContext(), new SequencedEvent(e));
|
||||
return true;
|
||||
KeyEvent ke = enqueuedKeyEvents.isEmpty() ? null : enqueuedKeyEvents.getFirst();
|
||||
if (ke != null && time >= ke.getWhen()) {
|
||||
TypeAheadMarker marker = typeAheadMarkers.getFirst();
|
||||
if (marker != null) {
|
||||
Window toplevel = marker.untilFocused.getContainingWindow();
|
||||
// Check that the component awaiting focus belongs to
|
||||
// the current focused window. See 8015454.
|
||||
if (toplevel != null && toplevel.isFocused()) {
|
||||
SunToolkit.postEvent(AppContext.getAppContext(), new SequencedEvent(e));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,6 +132,7 @@ class TestKFM extends DefaultKeyboardFocusManager {
|
||||
}
|
||||
protected synchronized void enqueueKeyEvents(long after, Component untilFocused) {
|
||||
super.enqueueKeyEvents(after, untilFocused);
|
||||
robot.delay(1);
|
||||
robot.keyPress(KeyEvent.VK_SPACE);
|
||||
robot.delay(50);
|
||||
robot.keyRelease(KeyEvent.VK_SPACE);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user