JBR-2712 Typeahead mechanism doesn't work on Windows

fix issue with newly opened popup not being recognized by screen reader
This commit is contained in:
Dmitry Batrak
2020-10-20 16:50:46 +03:00
parent 557b87f774
commit f5b6222835

View File

@@ -293,15 +293,16 @@ public class EventQueueMonitor
case MouseEvent.MOUSE_MOVED:
case MouseEvent.MOUSE_DRAGGED:
case FocusEvent.FOCUS_GAINED:
case WindowEvent.WINDOW_ACTIVATED:
case WindowEvent.WINDOW_DEACTIVATED:
queueComponentEvent((ComponentEvent) theEvent);
break;
case WindowEvent.WINDOW_ACTIVATED:
// Dialogs fire WINDOW_ACTIVATED and FOCUS_GAINED events
// before WINDOW_OPENED so we need to add topLevelListeners
// for the dialog when it is first activated to get a
// focus gained event for the focus component in the dialog.
case WindowEvent.WINDOW_GAINED_FOCUS:
// WINDOW_GAINED_FOCUS, WINDOW_ACTIVATED and FOCUS_GAINED events
// are fired before WINDOW_OPENED so we need to add topLevelListeners
// for the window when it is first focused to get a
// focus gained event for the focus component in it.
if (theEvent instanceof ComponentEvent) {
ComponentEvent ce = (ComponentEvent)theEvent;
if (ce.getComponent() instanceof Window) {
@@ -312,7 +313,6 @@ public class EventQueueMonitor
EventQueueMonitor.addTopLevelWindow(ce.getComponent());
}
}
queueComponentEvent((ComponentEvent) theEvent);
break;
// handle WINDOW_OPENED and WINDOW_CLOSED events synchronously