nvda
f6844c33 - UIA handler/notification event: handle elements without window handle property set such as window visual state announcements from File Explorer/Windows shell (#18229)

Commit
339 days ago
UIA handler/notification event: handle elements without window handle property set such as window visual state announcements from File Explorer/Windows shell (#18229) Closes #18220 Closes #17841 Summary of the issue: NVDA does not announce window visual states such as restore and snap when Windows+arrow keys are pressed. Description of user facing changes: NVDA will announce window visual states (for the foreground window) when Windows+arrow keys are pressed. Description of developer facing changes: Window state notifications are raised by a Windows shell (File Explorer) element without a native window handle. Therefore, allow notifications to be processed if the app module says yes, and if so, use foreground window handle as "window handle" for the element (because UIA NVDA objects require a window handle during construction even though all that will be done is process events). Description of development approach: In UIA handler/notification event handler: * If native window handle is not found (including traversing the UIA tree back to the root element), ask the app module for the process (where the element lives) if notification event should be processed. * If the app module says yes, set foreground window handle as "window handle" for the UIA element. Base app module: * Added a new method, "shouldProcessUIANotificationEventNoWindowHandle" to inform UIA handler if UIA notifications for elements without native window handle should be processed. * The new method will return False by default in line with previous behavior of dropping notification events for elements without window handle property set. File Explorer app module: * Say "yes" to "shouldProcessUIANotificationEventNoWindowHandle" call if window snap activity Id is being handled. * Added app module version of UIA notification event handler to announce window visual state/snap notification from everywhere. Testing strategy: Manual testing: from any app window (such as a web browser), press Windows+arrw keys to snap windows to part of the screen or press Windows+up arrow to maximize the foreground window. Prior to this PR: no window state announcement. After this PR: NVDA will announce window snap notification. Known issues with pull request: While the foreground window handle is an obvious choice (as the announcement pertains to window visual state changes), there might be a better way such as a custom UIA property. Ideally, window handle should be exposed by this shell element and hopefully Microsoft can resolve this. Note that File Explorer is not the only app with this issue - Windows 11 Voice Access exhibits the same problem (#16862).
Author
Parents
Loading