KeyEvents not reported to AT-SPI in apps pushing custom EventQueue
Submitted by Boris Dušek
Link to original bug (#754615)
Description
When running Android Studio (built on top of IntelliJ IDEA written in Swing), I noticed that Orca cannot enter flat review (using ORCA+P). I traced it down to Orca never receiving any keypress events from AT-SPI registry for the "ORCA" key (in my case Insert) and the "P" key (and any other keys).
I digged in and found out that for the custom EventQueue that is pushed as the toolkit's new systemEventQueue (AtkWrapper.java:672), its dispatchEvent method is called only once in the beginning during the whole run of the application (and that is with a non-key event, specifically a java.awt.event.InvocationEvent). The dispatchEvent method seems to be made to handle all the key presses and releases.
I tried adding AWTEvent.KEY_EVENT_MASK mask to the toolkit.addAWTEventListener call just above (AtkWrapper.java:667) and it seems that all the key events (presses and releases) started pouring in into the globalListener's eventDispatched method (AtkWrapper.java:274).
I do not have an idea why the custom EventQueue is not receiving any keypress (and release) events.
Linux: Ubuntu 15.04 x64 Java: Oracle JDK 1.8.0u60 java-atk-wrapper: 5876a9c0 (latest as of the time writing)
Version: 0.33.x