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
JAB: nvda should not treat ActiveDescendentChange
as a focus gained
event
#5989
Comments
We didn't realise PropertyActiveDescendentChange could be fired by
something other than the focus. I'm happy with the proposed fix.
|
@rpaquay, were you planning to submit a PR for this? (I realise there are several outstanding PRs from you already, but just wanted to check you weren't being blocked by something if you were planning to handle this.) |
Yes, but it is somewhat lower priority for me, as it is a not a blocking issue -- I implemented a workaround in Android Studio so that most components don't send the event if they don't have the input focus. I should still work on a patch for nvda, since my workaround does not cover 100% of cases. |
I think I have the same problem as reported above. I also reproduced the problem with a small Java application:
|
@rpaquay it would be great if you would open a pull request for this, I could try to build the project on my side and see if your fix also helps my problem. |
I managed to custom compile NVDA but as I do not know Python and the NVDA code I'm struggling coming up with a fix for this. Can you give me a suggestion about how the "internal_event_activeDescendantChange" method could be changed in order to avoid it firing a focus gained event if the component does not actually hold the focus?
|
@feerrenrut could you please have a look and see what still needs to be done for this one? |
…nent as focus gained event (nvaccess#5989)
…nent as focus gained event (nvaccess#5989)
…nent as focus gained event (nvaccess#5989)
…nent as focus gained event (PR #11048) Fixes: #5989 When a PropertyActiveDescendentChange event was received, nvda transformed it into a event_gainFocus event. The issue is that PropertyActiveDescendentChange can be raised by components (e.g. tree view) that don't have the focus. In that case, a PropertyActiveDescendentChange does not imply that the newly selected tree node has received the focus. Now, treat PropertyActiveDescendentChange event as 'focus gained event' only if event source has focus or it is an ancestor is the focused component.
Thanks for taking the time to work on this aspect, our end users will appreciate this. Is there a possibility for us to test the fix and give you feedback on it? Maybe a late night build? |
Yes, if you go to: https://www.nvaccess.org/files/nvda/snapshots/ and download the latest "alpha" snapshot (the first "download" link from the top of the page. Currently that is alpha-20317,6bf3ae5f which is the build which contains this fix (unless there is a problem, any newer builds should also contain the fix). |
I tested and I confirm this seems to be working for us, thanks for the fix |
See code at
nvda/source/JABHandler.py
Line 567 in 1aae748
When a
PropertyActiveDescendentChange
event is received, nvda transform it into aevent_gainFocus
event.The issue is that
PropertyActiveDescendentChange
can be raised by components (e.g. tree view) that don't have the focus. In that case, aPropertyActiveDescendentChange
does not imply that the newly selected tree node has received the focus.Take for example IntelliJ/Android Studio. When the user typed code in the text editor for a source file, for example a Java source file, IntelliJ/Android Studio asynchronously updates a tree contained in the "Stucture" toolwindow. The "Structure" toolwindow essentially shows the list of methods/nested classes, etc. of the currently edited source file. One of the feature of the "Structure" toolwindow is that it makes the tree node corresponding to the current java method active in the tree view, so when the caret moves from one method to another, the active node is updated (asynchronously). Node that the editor keeps the focus the whole time, and the tree itself never receives the focus.
In this example, the problem with the current implementation of the
PropertyActiveDescendentChange
event handler in the example above is that nvda assumes the editor loses the focus when the event is received. From then one, nvda will then ignore caret events because it thinks the component with the focus is the tree view.I think a reasonable fix would be to ignore
PropertyActiveDescendentChange
events unless the component sending the event (e.g. the tree) has the focus.The text was updated successfully, but these errors were encountered: