Skip to content

appModules/explorer: do not treat IAccessible Start button class as UIA element#13723

Merged
seanbudd merged 2 commits into
nvaccess:masterfrom
josephsl:i13717W11StartButtonClass
May 23, 2022
Merged

appModules/explorer: do not treat IAccessible Start button class as UIA element#13723
seanbudd merged 2 commits into
nvaccess:masterfrom
josephsl:i13717W11StartButtonClass

Conversation

@josephsl

@josephsl josephsl commented May 22, 2022

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes a possible regression from #13691
Follow-up to #13506
Fixes #13717

Summary of the issue:

On some Windows 11 systems, Start button is seen as IAccessible object rather than UIA element. This causes IAccessible handler to report attribute error when handling events as an attribute is not present in UIA elements.

Description of how this pull request fixes the issue:

On the surface, Start button window class name (Start) should be classified as a bad UIA window. However, when handling events from UIA handler thread, good UIA windows are checked before looking for bad UIA window class names. Because File Explorer's good UIA window method checks for the root element (the element being the ancestor of Start button), bad UIA window class name will not et a chance to detect IAccessible Start button. Therefore edit good UIA window method instead by checking for the specific class name in Windows 11.

Testing strategy:

Manual testing:

Prerequisites: Windows 11 Version 21H2 or later (test systems are running Version 22H2 preview (build 22621 beta):

  1. Run a build from this branch.
  2. Press Windows+D to show Desktop.
  3. Press Tab to move through shell elements such as Start button, Task View button, Taskbar, notification area, and back to Desktop.
  4. While performing step 3, make sure NVDA is saying something.

For detailed debug output, enable IAccessible and UIA debugging from Advanced settings panel, restart NVDA with debug logging enabled, then perform steps 2 through 4 from aboveabove. Then open the log and see what IAccessible and UIA handlers are saying about focus events.

Known issues with pull request:

None, although it might be possible that there are other Windows 11 shell elements that are showing as IAccessible as opposed to UIA.

Change log entries:

None needed as this is a follow-up to #13691.

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

Additional possibilities and context:

This issue occurs regardless of whether or not add-ons are on or off. Also, since Windows 11 shell is a UIA universe by default (checked many times after installing Windows 11 from scratch), it might be possible that something other than #13691 might be causing shell elements to be shown as IAccessible (perhaps a shell overlay or a Windows setting).

…IA window. Re nvaccess#13717.

Reported by a user: on some systems, Windows 11 Start button is seen as IAccessible (MSAA), not UIA, causing IAccessible handler to report AttributeError since event ID could not be found in UIA objects. Therefore in File Explorer app module, do not treat IAccessible Start button (window class name: Start) as UIA element.
@josephsl josephsl requested a review from a team as a code owner May 22, 2022 16:35
@josephsl josephsl requested a review from seanbudd May 22, 2022 16:35
Comment thread source/appModules/explorer.py Outdated
Comment on lines +532 to +536
)
):
return True
# #13717: on some systems, Windows 11 shell elements are reported as IAccessible,
# notably Start button, causing IAccessible handler to report attribute error when handling events.
if winUser.getClassName(hwnd) != "Start":

@seanbudd seanbudd May 23, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be added to the parent if statement.

@josephsl

josephsl commented May 23, 2022 via email

Copy link
Copy Markdown
Contributor Author

…eck with other class name checks. Re nvaccess#13717.

Tip from Sean Budd (NV Access): move Start button class name check to the parent boolean - that is, package Windows 11 + shel elements + excluding IAccessible Start button under 'logical and' check.
@AppVeyorBot

This comment was marked as off-topic.

@seanbudd seanbudd merged commit 23690b2 into nvaccess:master May 23, 2022
@nvaccessAuto nvaccessAuto added this to the 2022.2 milestone May 23, 2022
@josephsl josephsl deleted the i13717W11StartButtonClass branch May 24, 2022 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nvda not reading start menu button

4 participants