No longer set focused state for accessibility for non focused WX list items#16289
Merged
Conversation
Contributor
|
@lukaszgo1 really thanks so much for your work. I confurm this pr fixes the problem that I reported, as expected. |
Contributor
Author
|
@michaelDCurran @seanbudd Can this be added to 2024.1 milestone for tracking purposes? |
seanbudd
approved these changes
Mar 12, 2024
Member
|
Thanks @lukaszgo1 |
Adriani90
pushed a commit
to Adriani90/nvda
that referenced
this pull request
Mar 13, 2024
… items (nvaccess#16289) Fixes nvaccess#16280 Summary of the issue: For not fully accessible WX checkable list boxes / list views, NVDA implements custom wx.Accessible class, which exposes proper roles / states. Since WX list boxes have no method to determine if the given item is focused, it was assumed that selected item is always focused. This is not true when the list box itself has no focus. For a long time this was causing only a minor annoyance - when using object navigation to access the not focused list selected item was reported as having focus. With the introduction of tcheckable list into speech settings panel, this is causing the list of available speech modes to receive focus when user changes the synthesizer. It seems that when the controls are re-created Windows notices that the first list item has a focused state, checks that it has no focus and emits a focus event to "correct" this. As to why this is not a problem when creating this panel I guess that controls are created when it is hidden, and focus events are not emitted for non visible windows. Description of user facing changes Selected checkable list items are no longer reported as focused unless they really have focus When changing synthesizer from the speech settings panel list of available speech modes no longer gains accessibility focus Description of development approach Focused state is exposed for selected list box item only when the list box itself is focused. I have tried to use Win32 API to retrieve the real focused items from these controls using LB_GETCARETINDEX for the list box and LVM_GETITEMSTATE for the checkable multi columns list, unfortunately these approaches seem to return index of last focused item even when the parent list no longer has focus.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opened against beta, since this PR fixes a regression from 2024.1 development cycle.
Link to issue number:
Fixes #16280
Summary of the issue:
For not fully accessible WX checkable list boxes / list views, NVDA implements custom
wx.Accessibleclass, which exposes proper roles / states. Since WX list boxes have no method to determine if the given item is focused, it was assumed that selected item is always focused. This is not true when the list box itself has no focus. For a long time this was causing only a minor annoyance - when using object navigation to access the not focused list selected item was reported as having focus. With the introduction of tcheckable list into speech settings panel, this is causing the list of available speech modes to receive focus when user changes the synthesizer. It seems that when the controls are re-created Windows notices that the first list item has a focused state, checks that it has no focus and emits a focus event to "correct" this. As to why this is not a problem when creating this panel I guess that controls are created when it is hidden, and focus events are not emitted for non visible windows.Description of user facing changes
Description of development approach
Focused state is exposed for selected list box item only when the list box itself is focused. I have tried to use Win32 API to retrieve the real focused items from these controls using
LB_GETCARETINDEXfor the list box andLVM_GETITEMSTATEfor the checkable multi columns list, unfortunately these approaches seem to return index of last focused item even when the parent list no longer has focus.Testing strategy:
Ensured that for checkable list focused state is exposed only when the list has focus. Verified that after changing the synthesizer from the speech panel focus returns to the 'change' button, or to the edit field with the synthesizer name.
Known issues with pull request:
The speech settings panel behaves incorrectly when user is focused on one of the synthesizer controls such as the rate slider and invokes the change synthesizer dialog - in that case after the new synth is selected focus lands in the list of available speech modes list. This is not new behavior - in 2023.3 focus landed in limbo in this case.
Code Review Checklist: