Windows 10/11 Calculator: use UIA find descendants when fetching results while handling UIA notification event#14745
Merged
seanbudd merged 5 commits intoMar 28, 2023
Conversation
…access#14679. If a portable copy of NVDA is running and compact overlay mode is active from Calculator, NVDA will not announce results as users type expressions, caused by index error stemming from tree traversal failure. As an alternative, use UIA descendants to locate results element, allowing portable NVDA to announce results when Calculator is in compact overlay mde. The find descendants code ultimately comes from the one employed in File Explorer when fetching status bar items.
…fetching results element. Re nvaccess#14679. NVDA had to descend one more level when fetching results in Windows 11 Calculator. Now that the moer modern Calculator is available on Windows 10 along with use of UIA descendants to fetch results element, there is no need to check app version.
Member
|
What happens here with older version of Windows 10? |
Contributor
Author
|
Hi, Older Windows 10 Calculator releases do not fire UIA notification event, so we can ignore it. Newer Windows Calculator releases were initially made available to Windows 11 but was made available to Windows 10 Version 2004 and later (as far as consumers and businesses are concerned, the oldest supported version is 20H2; LTSC can be ignored becasue Windows Calculator is unavailable on that channel). By the way, Calculator compact overlay mode is also called always on top mode. Thanks. |
seanbudd
approved these changes
Mar 28, 2023
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.
Link to issue number:
Closes #14679
Summary of the issue:
Portable NVDA does not announce results when Windows 10/11 Calculator is in compact overlay mode.
Description of user facing changes
Portable copy of NVDA will announce calculator expressions and results when Windows Calculator is in compact overlay mode (Alt+up arrow from standard calculator mode).
Description of development approach
Instead of using tree traversal, use UIA find descendants approach (employed in File Explorer) to obtain results element when Calculator is in normal and compact overlay mode. This also removes the need to check Calculator version as Windows 11 Calculator has made its way to Windows 10.
Testing strategy:
Manual testing:
Prior to this PR: portable NVDA would not announce anything or play error tones.
Expected: Portable NVDA will announce expressions and results when Calculator is in compact overlay mode.
The code was also tested with Windows App Essentials add-on.
Known issues with pull request:
If COM error occurs, UIA notification event handler will simply exit, but no issues so far.
Change log entries:
Bug fixes:
In Windows 10 and 11 Calculator, portable copy of NVDA will no longer do nothing or play error tones when entering expressions in standard calculator in compact overlay mode. (#14679)
Code Review Checklist: