Skip to content

Windows 11 22H2: add good UIA window class names for system tray overflow window and Open With dialog to allow mouse and touch interaction#14540

Merged
seanbudd merged 10 commits into
nvaccess:masterfrom
josephsl:win11-22h2ExplorerOpenWithGoodUIAWindow
Jan 16, 2023
Merged

Windows 11 22H2: add good UIA window class names for system tray overflow window and Open With dialog to allow mouse and touch interaction#14540
seanbudd merged 10 commits into
nvaccess:masterfrom
josephsl:win11-22h2ExplorerOpenWithGoodUIAWindow

Conversation

@josephsl

@josephsl josephsl commented Jan 14, 2023

Copy link
Copy Markdown
Contributor

Link to issue number:

Closes #14538
Closes #14539

Summary of the issue:

Mouse and/or touch interaction does not work properly for Windows 11 22H2 UI, including upcoming redesigned system tray overflow window and Open With dialog.

Description of user facing changes

Mouse and touch interaction will work when opening system tray overflow window and Open With dialog in Windows 11 2022 Update.

Description of development approach

Edited "isGoodUIAWindow" found in File Explorer and Open With app modules to classify the following window class names as good UIA windows:

  • File Explorer: TopLevelWindowForOverflowXamlIsland (upcoming redesigned system tray overflow window)
  • Open With: Open With (top-level window for the dialog)

Along with this change, type information were added to these methods.

Testing strategy:

Manual testing (prereq: mouse and/or touchscreen; for mouse, mouse tracking should be turned on and NVDA sould be told to follow mouse from review cursor settings panel):

Redesigned system tray overflow window (Windows 11 22H2 build 22623 and later): press Windows +B to move focus to "show hidden icons" button, press Space to expand it, then use the mouse to move around the overflow window (located above the icons button).

Open With dialog: click on a file type that Windows cannot open (such as a pickle file) and use the mosue and/or touch to navigate and interact with the dialog.

Known issues with pull request:

None

Change log entries:

Bug fixes (under Windows 11 section):

In Windows 11 22H2, it is again possible to use mouse and touch interaction to navigate and interact in areas such as redesigned system tray overflow window and Open With dialog. (#14538, #14539)

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
  • Security precautions taken.

… window. Re nvaccess#14538.

Windows 11 22H2 (at least newer updates) include modernized Open With dialog powered by WinUI, meaning no proper mouse and/or touch interaction. Therefore treat the top window for this dialog as a good UIA window so mouse and touch interaction can work properly. Also, rewrite isGoodUIAWindow method with one window class name per line.
…ood UIA window. Re nvaccess#14539.

Later revisions of Windows 11 Version 22H2 (2022 Update) comes with redesigned system tray overflow window (class name: TopLevelWindowForOverflowXamlIsland) but without proper mouse and touch interaction from NVDA. Therefore, add the new class as a good UIA window so mouse and touch interaction can work.
@josephsl josephsl requested a review from a team as a code owner January 14, 2023 21:50
@josephsl josephsl requested a review from seanbudd January 14, 2023 21:50
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 45dfc05319

@mzanm

mzanm commented Jan 15, 2023

Copy link
Copy Markdown
Contributor

Hello.
All the windows that block touch or mouse access seem to have the name 'DesktopWindowXamlSource', with a role of unknown or pane. I think it would be better to make a window like this UIA or just transparent to mouse instead of manually adding class names for everything. What about apps from the Microsoft Store that use XAML.

@josephsl

josephsl commented Jan 15, 2023 via email

Copy link
Copy Markdown
Contributor Author

@josephsl

Copy link
Copy Markdown
Contributor Author

Hi,

Just telling NVDA that XAML source windows are UIA won't be enough - it is part of aps (specifically, WinUI/XAML Islands), and it is really the top-level windows that are seen as IAccessible, thus these windows must be the ones reclassified as UIA. We can't also rely on the idea that XAML source windows will have the same window class names across apps - class names are different between File Explorer and Windows Terminal. Most importantly, if XAML source window is reclassified as a UIA element, it leads to NVDA becoming unresponsive at startup for several seconds.

Thanks.

Comment thread source/appModules/explorer.py Outdated
Comment thread source/appModules/openwith.py Outdated
@josephsl

josephsl commented Jan 16, 2023 via email

Copy link
Copy Markdown
Contributor Author

Comment thread source/appModules/openwith.py Outdated
# #11335: Open With dialog isn't read in Windows 10 Version 2004 (May 2020 Update).
# Note that treating the below window as a UIA window will make NVDA no longer announce "pane".
if winUser.getClassName(hwnd) == "Shell_Flyout":
from winAPI.types import HWNDValT

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.

You should probably pull these imports out to the top of the file

…dule.

Suggested by Sean Budd (NV Access): move winAPI import to the top of the modules.
@seanbudd seanbudd merged commit fedf666 into nvaccess:master Jan 16, 2023
@nvaccessAuto nvaccessAuto added this to the 2023.1 milestone Jan 16, 2023
@josephsl josephsl deleted the win11-22h2ExplorerOpenWithGoodUIAWindow branch January 19, 2023 22:40
@Rockstar50373

Rockstar50373 commented Jan 20, 2023 via email

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

6 participants