Ignore events where Java Access Bridge is unable to provide a window handle#13796
Conversation
…handle, prevents errors when trying to create the NVDA objects
See test results for failed build of commit 493469ab01 |
See test results for failed build of commit 5dd5e92750 |
|
Thanks @mwhapples |
|
Sorry @mwhapples I just noticed this part in the PR description:
Can you point out where this occurs? Perhaps this is something we can avoid and fix for JAB. |
For the vast majority of Java Access Bridge calls a window handle is not needed. The only ones which come to mind are the functions where one wants to check if a window is a Java application or to get the window handle for a Java application. This means that for gathering the information about the application and what has changed in an event does not need a window handle. Thus Java Access Bridge API does allow us to continue processing the event without a window handle. |
I'm sure this is technically possible, but if we do not have the motivation to do so, there is no need to do the work. |
|
Thanks @mwhapples |
Link to issue number:
Closes #13039
Summary of the issue:
When launching IntelliJ IDEA you minimise all windows with Windows+M before the IntelliJ window comes into view, then you get many errors and IntelliJ will take a long time to load. In addition NVDA will log many errors.
Description of how this pull request fixes the issue:
It seems like if a Java window never gets shown then Java Access Bridge is unable to get a window handle for it. Also the caching of window handles in NVDA's Java Access Bridge is unable to help as the Java window was never in focus. As the affected window is in the background and as there is nothing more NVDA can do to solve this I have checked for the presence of a window handle in the Java Access Bridge event handling, if no window handle is present then the event is ignored.
Testing strategy:
Manual testing. Tested using the steps in the issue. Also did some other use of Java applications to observe if this fix has negative impacts anywhere else, none found.
Known issues with pull request:
Technically these events could be processed as the Java Access Bridge objects contain all accessible information, so we are throwing away events when may be we could process them. However due to NVDA Window objects insisting on a window handle we cannot proceed with processing due to the NVDA limitation.
Change log entries:
New features
Changes
Bug fixes
For Developers
Code Review Checklist: