Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVDA throws a lot of errors during opening IntelliJ IDEA #13039

Closed
cary-rowen opened this issue Nov 8, 2021 · 10 comments · Fixed by #13796
Closed

NVDA throws a lot of errors during opening IntelliJ IDEA #13039

cary-rowen opened this issue Nov 8, 2021 · 10 comments · Fixed by #13796
Labels
p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Milestone

Comments

@cary-rowen
Copy link
Contributor

cary-rowen commented Nov 8, 2021

Steps to reproduce:

  1. Go to jetbrains.com/idea to download and install IntelliJ IDEA Community Edition 2021.2.3;
  2. After installation, follow the default settings and create a new project arbitrarily;
  3. Exit IntelliJ IDEA;
  4. Open IntelliJ IDEA again, it will take a while to load, press Windows + M to minimize to the desktop during this time;

Actual behavior:

During the execution of step (4), you will receive a large number of errors from NVDA when you minimize to the desktop. The log snippet is as follows:

ERROR - queueHandler.flushQueue (09:19:24.473) - MainThread (16392):
Error in func event_stateChange
Traceback (most recent call last):
  File "queueHandler.pyc", line 55, in flushQueue
  File "JABHandler.pyc", line 709, in event_stateChange
  File "NVDAObjects\__init__.pyc", line 85, in __call__
  File "NVDAObjects\JAB\__init__.pyc", line 231, in __init__
  File "NVDAObjects\window\__init__.pyc", line 167, in __init__
ValueError: invalid or not specified window handle

IntelliJ IDEA will be opened after you receive dozens of errors.

Expected behavior:

NVDA has no error messages and IntelliJ IDEA should open smoothly,.

System configuration

NVDA installed/portable/running from source:

installed and portable

NVDA version:

NVDA2021.3 Beta2

Windows version:

Windows 10 21H1 (x64) build 19043.1288

Name and version of other software in use when reproducing the issue:

IntelliJ IDEA Community Edition 2021.2.3

Other information about your system:

  • CPU: Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz 1.90 GHz
  • RAM: 16.0 GB
  • Disk: 512 GB SSD

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

The latest Alpha version can also be reproduced

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes

@Brian1Gaff
Copy link

Brian1Gaff commented Nov 8, 2021 via email

@cary-rowen
Copy link
Contributor Author

Yes, this is a program written in Java.

@cary-rowen
Copy link
Contributor Author

@michaelDCurran @LeonarddeR
Do you have any thoughts on this?

@cary-rowen
Copy link
Contributor Author

cc @seanbudd
Could you please take a look at this issue?

@dpy013
Copy link
Contributor

dpy013 commented Dec 28, 2021

The same problem was encountered when using jetbrains

@mwhapples
Copy link
Collaborator

I have started taking a look at this. Something very important in reproducing which I did not initially appreciate, is needing to minimise the windows with Windows+M. If you do not minimise the windows then you do not get the errors.

@cary-rowen
Copy link
Contributor Author

thanks @mwhapples
Yes, minimization is a necessary step.

@mwhapples
Copy link
Collaborator

@cary-rowen I have created a fix for this see pull request #13796 could you try it to see if that fixes the issue for you, in particular the speed of IntelliJ loading. The best I could come up with is to ignore the events causing the errors. It seems like Java Access Bridge cannot provide the window handle for Java windows which have never been shown on the screen. By ignoring the events it means NVDA will not spend time processing the errors and so should not unnecessarily slow down IntelliJ. As IntelliJ is minimised at this point ignoring these events should not impact on user experience.

@cary-rowen
Copy link
Contributor Author

@mwhapples
Thanks for your effort, I tested build #13796 and it worked fine for me, thanks again.
Hopefully this will be part of 2022.2 if possible.

@mwhapples
Copy link
Collaborator

That is great news. I suspect that this won't be included in 2022.2 because I think that has already been branched. Personally knowing the size of this change and its limited scope for causing unrelated issues, I would port it to the 2022.2 branch but I don't get to make that decission.

@seanbudd seanbudd added p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. labels Jun 16, 2022
@seanbudd seanbudd added p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority and removed p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority labels Jun 16, 2022
seanbudd pushed a commit that referenced this issue Jun 27, 2022
…handle (#13796)

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.
@nvaccessAuto nvaccessAuto modified the milestone: 2022.3 Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants