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

Windows 11 Design Elements Are Not Reported by NVDA When Mouse Tracking Is On #13506

Open
ferhatbkr opened this issue Mar 18, 2022 · 20 comments
Open
Labels
audience/low-vision PR or issue is relevant to sighted or low vision users feature/mouse-tracking p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority platform/Windows11 Issues specific to Windows 11 triaged Has been triaged, issue is waiting for implementation.

Comments

@ferhatbkr
Copy link

Steps to reproduce:

  • Turn on mouse tracking in NVDA.
  • Hover mouse cursor over taskbar items. In the same way, navigate the toolbar buttons of Windows Explorer, the top menus of the New Notepad application with the mouse.

Actual behavior:

NVDA will just say "DesktopWindowXamlSource" instead of naming items.
The same is true for all applications developed with Windows 11's new Flat Design. Like PowerToys that don't come pre-installed with Windows.
Narrator items read their names as expected.

Expected behavior:

NVDA must accurately report information on items, as Narrator does.

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

NVDA 2021.3.4

Windows version:

Windows 11 Version 10.0.22000.588 Build 22000.588

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

Other information about your system:

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.

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

@josephsl
Copy link
Collaborator

Hi,

Can you tell us things Narrator says so we can investigate what's going on?

Technical: these design elements expose class names as their label (name).

Thanks.

@josephsl
Copy link
Collaborator

Hi,

Also, note that design elements are not really the same thing as item labels, and I think that could confuse people.

Thanks.

@Molitvan
Copy link

I have the same problem. Also, I noticed that its happening with almost all new ms apps like windows terminal for example. I assume that some library used in these apps/elements is making an issue.

Also, I think there is a way to fix the problem with taskbar. Actualy, in windows 11, there is some kind of a cover on top of the taskbar. This cover makes nvda read that instead of the actual taskbar when you hover over it. You can test this by simply hovering over the top edge of the taskbar. If there is a way to remove this, the taskbar will work. Also, by removing that cover you will restore the old taskbar context menus :D.

I will update this comment if my theory about the taskbar turns out to be true

@ferhatbkr
Copy link
Author

Hi,

Can you tell us things Narrator says so we can investigate what's going on?

Technical: these design elements expose class names as their label (name).

Thanks.

The name or tooltip of the Start Menu, pinned applications, and system tray items (including date and time) in the Taskbar is not reported by NVDA.

In Windows Explorer, buttons and menus on the bar that Narrator calls "Application Bar" (ex: new, cut, copy, rename buttons and sort, view menus) are not spoken.

I said "design element" because I had this problem in applications updated according to this design, which came with the new design of Widnows 11. My fault.

@josephsl
Copy link
Collaborator

Hi,

About terminology: yep, I can see why it can be confusing.

Also another technical note: until Windows 10 at least shell elements such as Start button label was exosed as a MSAA (Microsoft Active Accessibility) objects, whereas they are seen as UIA (UI Automation) objects in Windows 11.

Thanks.

@seanbudd seanbudd added feature/mouse-tracking platform/Windows11 Issues specific to Windows 11 p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority audience/low-vision PR or issue is relevant to sighted or low vision users triaged Has been triaged, issue is waiting for implementation. labels Mar 21, 2022
@josephsl
Copy link
Collaborator

Hi,

Dramatic turn: this explains why touch hover gesture (hold down one finger while navigating the screen) is not effective in Windows 11 taskbar - no item announcement when one hovers around the bottom of the screen. I will raise a separate issue for touchscreen interaction as looks like these might be related.

Thanks.

@josephsl
Copy link
Collaborator

Hi,

April 2022 update: telling NVDA to treat DesktopWindowXamlSource objects as UIA fixes it for BOTH mouse and touch interaction. Note that there are multiple elements with this "label", so the easy fix will require informing the File Explore app module that these elements are indeed UIA objects. I'll come up with a prototype fix via Windows App Essentials add-on if possible (possibly later today which will require changes to File Explorer app module).

Thanks.

@josephsl
Copy link
Collaborator

Hi,

Update: yes, UIA element reclassification fixes it. For folks wishing to write a pull request (I can do so next week if needed), the following window class names must be checked from isGoodUIAWindow method in File Explorer app module class: MSTaskSwWClass (parts of taskbar), TrayNotifyWnd (systray list), ToolbarWindow32 (toolbar), ReBarWindow32 (parts of taskbar), Shell_TrayWnd (taskbar). Of course you must make sure this is Windows 11 or later. I'm sure there is a much better solution.

Thanks.

@josephsl
Copy link
Collaborator

Hi,

For Windows 11 Notepad, a window with the class name of "Notepad" shuold be treated as good UIA window. Because of this, a solution that works across programs is ideal.

Additional findings:

  1. DesktopWindowXamlSource class name is used by classic Win32 apps to host XAML controls.
  2. A more effective solution is detecting these windows from UIA handler thread itself and telling NVDA to treat these as good UIA windows. While editing isGoodUIAWindow method from app modules would work, it isn't generalizable across apps as the class name in question (see above) is found across multiple apps.
  3. No separate issue is required to describe touchscreen interaction behavior as the issue described here impacts both mouse and touch. Therefore a pull request that fixes this problem will affect both interaction scenarios at once.
  4. As a workaround, enable "report tooltips" from object presentation settings panel and enable "follow mouse cursor" checkbox from review cursor settings panel.
  5. Although the computer used to test possible solutions is running a nickel build (22598 to be exact), a pull request for this issue will also work on Windows 11 Version 21H2 (build 22000) as evidenced by the fact that the described workaround and potential solutions are working in a virtual machine running the said build.

As for pull requests, while I may not be able to come up with a solution that works across apps (I'm exhausted), I can do something about at least File Explorer (Windows 11 Notepad will be handled via Windows App Essentials for now).

CC @michaelDCurran in case you heard something from XAML team inside Microsoft.

Thanks.

@lukaszgo1
Copy link
Contributor

Just out of interest I've looked into this briefly and I'm not understanding something here. Given that NVDA correctly decides to use UIA for these controls when accessed via keyboard why the same fails when done via mouse / touch screen. In other words why objectFromPoint returns the MSAA hosting window rather than the real UIA object?

@josephsl
Copy link
Collaborator

josephsl commented Apr 23, 2022 via email

@mzanm
Copy link
Contributor

mzanm commented Apr 23, 2022

I'm not sure if this is really possible or not, but can't any window with the role of unknown or pane and name of "DesktopWindowXamlSource" be considered a good UIA window? I don't think adding window class names will work, as a name needs to be added for each app, for example mouse navigation on windows terminal is broken and it has the window lass name of "CASCADIA_HOSTING".

@josephsl
Copy link
Collaborator

josephsl commented Apr 23, 2022 via email

@josephsl
Copy link
Collaborator

Hi,

UIA reclassification method cannot be used with Windows Terminal - if I do it, when the mouse moves to terminal window, the app crashes. This is observed with both global plugin and app module method.

Thanks.

@josephsl
Copy link
Collaborator

josephsl commented May 2, 2022

Hi,

Expect a pull request to resolve part of this issue soon - likely limited to cover shell elements such as Taskbar as this is one of the most prominent areas of the operating system and likely to be navigated with mouse and/or touch. Notepad and File Explorer command bar (that's what they are really) may or may not be covered.

P.S. In the upcoming pull request, File Explorer app module will state that a more permanent solution be found and my workaround removed once that happens.

Thanks.

@josephsl
Copy link
Collaborator

josephsl commented May 9, 2022

Hi,

May 2022 update: until a general solution is found, for File Explorer/shell elements, the following solutions are available that involves good UIA window method:

  1. Selective class names: provide a list of window class names representing various shell elements such as taskbar, notification area, and device-specific items such as touch keyboard button (check with user32.dll::GetClassName(hwnd) wrapped inside winUser module). While the solution is very specific, additional class names must be added once discovered - if not now, perhaps in future Windows 11 updates.
  2. Ancestor checks: check ancestor (mostly top-level_ windows by calling user32.dll::GetAncestor function with GA_ROOT (2) as ancestor parameter (this function is wrapped as winUser.getAncestor(hwnd)). This allows any element hosted (child of) by a limited number of top-level windows to be recognized and navigated to at the cost of performance as Windows (specifically, window manager) must navigate GUI hierarchy.
  3. Go all in on UIA except for one or two class names: in other words, all File Explorer windows should be classified as UIA elements except for ones requiring IAccessible implementation (mostly ones with odd UIA server-side implementation such as desktop icons/SysListView32). While not as specific as the above two solutions, only a limited set of class names are checked which helps in performance but may expose issues with UIA elements so a cautionary note must be added.

Even with one or more of these solutions implemented, the pull request MUST include a note that a more general solution is ideal to cover other programs such as Notepad and Windows Terminal. I'm leaning toward either a second or a third solution unless folks believe the first solution is better or offer something completely different (including unexpected solutions).

In summary:

  1. Reclassifying windows that host a window named "DesktopWindowXamlSource" as UIA windows partially solves the problem (causes a crash in Windows Terminal according to tests, hence a partial solution).
  2. DesktopWindowXamlSource windows are found in Win32 (desktop) apps that host XAML controls. In Windows 11, this is prominent if an app uses WinUI framework. These windows are found not only in File Explorer, but also in apps such as Windows 11 Notepad and Windows Terminal, so likely a hybrid solution involving app modules and accessibility API handlers (and even NVDA objects) is the best.
  3. This issue is not present in Windows 10, thus the solutions should target at least Windows 11 Version 21H2 (RTM/build 22000).
  4. Solving mouse navigation problem for DesktopWindowXamlSource windows can resolve touchscreen interaction with controls hosted within them. Therefore testing solutions with mouse is required (and touch is recommended if the computer is equipped with a touchscreen).

Next steps: within the next 72 hours, a PR will be submitted which will implement the third solution unless folks prefer something else in the meantime.

Thanks.

@XLTechie
Copy link
Collaborator

XLTechie commented May 9, 2022

@josephsl while this issue is somewhat outside my area of study, a thought occurs.

Your solution 2, in the last comment, seems like, from your description, to be the least likely to come up with false results. However it is slow.
Would some sort of caching be possible here? An in-memory cache of successes and failures, to prevent having to back-walk the tree for every control after it is once known?

@josephsl
Copy link
Collaborator

josephsl commented May 9, 2022 via email

@josephsl
Copy link
Collaborator

Hi,

Upon further testing, solution 2 will be the way to go (no performance issues observed while testing compared to solutions 1 and 3) - implementing solution 3 causes NVDA to say "system" when Alt+Space is pressed instead of it saying "restore" as before (regression). Also, adding isGoodUIAWindow to check for UI design elements will change UIA tree as seen by NVDA (at least observed in Notepad), requiring edits to code that traverses the object hierarchy to locate things; thankfully it doesn't affect File Explorer. Pull request incoming (I may not respond to reviews until late May but a PR will be provided for commenting or solutions to be offered by others).

Thanks.

josephsl added a commit to josephsl/nvda that referenced this issue May 12, 2022
… windows to allow mouse and ouch navigation to work. Re nvaccess#13506.

When using the mouse and/or touch to navigate Windows 11 shell elements such as tskbar and other buttons, NVDA says 'DesktopWindowXamlSource'. This window title is employed from desktop (Win32) apps hosting XAML controls. Reclasifying these controls as well as some top-level windows from IAccessible to UIA does allow mouse and touch interaction to work. Because DesktopWindowXamlSource class label is seen in apps such as Notepad and Windows Terminal (in addition to File Explorer), a comment was added to indicate that a more global solution would be better. But for now at least shell elements can be navigated with mosue and/or touch.
josephsl added a commit to josephsl/nvda that referenced this issue May 12, 2022
…ne when checking Windows 11 shell elements. Re nvaccess#13506.

Turns out checking just the class name is not enough for shell root window (Shell_TrayWnd) - one needs to check ancestors. Because other windows are top-level windows (such as Task View), class name check will work, but for consistency, call winUser.getAncestor with root (winUser.GA_ROOT (2)) flag. Also add an explanation as to why.
josephsl added a commit to josephsl/nvda that referenced this issue May 12, 2022
…s release. Re nvaccess#13506.

Small optimization: winVersion.getWinVer() can be called up to two times (if running on Windows 11), therefore use a variable to store current Windows release and use it throughout the method.
seanbudd added a commit that referenced this issue May 19, 2022
…IA to allow mouse and touch navigation to work while interacting with shell elements (#13691)

#13506 (partial)

Summary of the issue:
Windows 11 UI (shell) elements such as taskbar, notification area, TaskView, Snap layouts, and buttons such as Search and Chat cannot be navigated to and interacted with mosue and touchscreens.

Description of how this pull request fixes the issue:
Reclassifies the following windows as UIA windows:

Shell_TrayWnd: Start, Search, Widgets, other shell elements nadi s the rot shell elements window (not to be conrused with desktop window)
Shell_InputSwitchTopLevelWindow: language switcher
XamlExplorerHostIslandWindow: Task View and Snap Layouts
Most of these have the label of "DesktopWindowXamlSource". The "isGoodUIAWindow" in File Explorer app module was edited to treat these windows as UIA elements provided that they are the ancestors (top-level windows) of windows passed into that method. This is more so for the first window class name (shell root) whereas others can go through just a class name check, but cal winUser.getAncestor with GA_ROOT (2) flag for all windows for consistency.


* appModules/explorer: reclassify Windows 11 UI (shell) elements as UIA windows to allow mouse and ouch navigation to work. Re #13506.

When using the mouse and/or touch to navigate Windows 11 shell elements such as tskbar and other buttons, NVDA says 'DesktopWindowXamlSource'. This window title is employed from desktop (Win32) apps hosting XAML controls. Reclasifying these controls as well as some top-level windows from IAccessible to UIA does allow mouse and touch interaction to work. Because DesktopWindowXamlSource class label is seen in apps such as Notepad and Windows Terminal (in addition to File Explorer), a comment was added to indicate that a more global solution would be better. But for now at least shell elements can be navigated with mosue and/or touch.

* appModules/explorer: check ancestors instead of window class name alone when checking Windows 11 shell elements. Re #13506.

Turns out checking just the class name is not enough for shell root window (Shell_TrayWnd) - one needs to check ancestors. Because other windows are top-level windows (such as Task View), class name check will work, but for consistency, call winUser.getAncestor with root (winUser.GA_ROOT (2)) flag. Also add an explanation as to why.

* appModules/explorer: use a dedicated variable to store current Windows release. Re #13506.

Small optimization: winVersion.getWinVer() can be called up to two times (if running on Windows 11), therefore use a variable to store current Windows release and use it throughout the method.

* update changes

Co-authored-by: Sean Budd <sean@nvaccess.org>
seanbudd pushed a commit that referenced this issue May 23, 2022
…IA element (#13723)

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):

Run a build from this branch.
Press Windows+D to show Desktop.
Press Tab to move through shell elements such as Start button, Task View button, Taskbar, notification area, and back to Desktop.
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.

* appModules/explorer: do not treat IAccessible Start button class as UIA window. Re #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.

* appModules/explorer: combine Start button IAccessible object class check with other class name checks. Re #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.
seanbudd pushed a commit that referenced this issue Jun 21, 2022
When checking the change log translation, I have found a wrong reference in an item of the change log. I have thus checked all the refs for 2022.2.

Link to issue number:
None
Follow-up of various issues.

Summary of the issue:
Some of the GitHub references in the change log were targetting wrong issue or PR.

Description of user facing changes
The references have been fixed in the change log document.

Description of development approach
Fixed the following references:

Fixup of PR 13082: fix a misspell in DefaultAppArgs and no longer use globalVars.appArgs in a boolean context (#13386) #13386 replaced by Windows 10/11 Calculator: allow NVDA to announce more operations by suppressing only a limited number of keyboard commands #13383
Revert "Update to py2exe 0.11.0.1 (#13066)" #13508 replaced by Windows 11 Design Elements Are Not Reported by NVDA When Mouse Tracking Is On #13506
Fixup of PR 13082: fix a misspell in DefaultAppArgs and no longer use globalVars.appArgs in a boolean context (#13386) #13386 (bis) replaced by Windows 11 Notepad: status bar is not announced #13688
Also, I have replaced #13276 (Libre Office issue) by #13277 (associated PR) since the issue description is not related at all with the change for developers.
@josephsl
Copy link
Collaborator

josephsl commented Nov 3, 2023

Hi,

November 2023 update: I think I found a possibly more general solution: use windowUtils.findDescendantWindow(hwnd, className="Windows.UI.Composition.DesktopWindowContentBridge"). Looks like the issue with Windows Terminal where mouse movement crashes it is gone.

The bigger problem: how do we detect top-level windows and at which point should we check for descendants?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audience/low-vision PR or issue is relevant to sighted or low vision users feature/mouse-tracking p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority platform/Windows11 Issues specific to Windows 11 triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

No branches or pull requests

7 participants