appModules/calculatorapp: add support for Windows 11 Calculator#13215
Merged
Conversation
…ication event in Windows 11 version. Re nvaccess#13212. In Windows 11 Calculator, due to UI redesign, app interface lives inside the last child of the foreground window (foregroundObject.children[1].lastChild.firstChild), therefore check product version and descend one more level if this is Windows 11 version. This is only one of several changes introduced in Windows 11 Calculator.
…alias for Windows 10 Calculator. Re nvaccess#13212. The biggest change between Windows 10 and 11 Calculator app is renamed executabel - calculator.exe -> calculatorapp.exe. Following precedence from other Windows apps, add Windows 11 Calculator as an alias for Windows 10 version, with the latter also adding version checks for Windows 11 version (similar in arrangemenet to emoji panel support in Windows 10/11).
feerrenrut
reviewed
Jan 4, 2022
Contributor
Author
|
Hi, it is a legacy of old releases where UIA notification event can come from multiple elements, and in some cases, elements are next to unit converter interface. After testing the event handler, it turns out attribute error check is not needed in recent releases, therefore I’m going to rework this and apply a point about assigning product version somewhere (likely at the start of the event handler). Thanks for reminding me to stay updated on things.
|
…remove legacy try/except statements. Reviewed by Reef Turner (NV Access): A try/AttributeError exception check was present in order to support older Windows 10 Calculator releases, mostly to detect notifications coming from unit converters. As of January 2022, this legacy code is no longer needed as legacy code is used in Calculator releases in older Windows 10 feature updates such as Version 1709 which is unsupported (the latest version of Windows 10 is 10.2103). Besides, version variable was defined in attribute error exception handler, which isn't ideal and makes the code harder to read. Therefore remove the redundant try/except statements and fetch results screen as part of 'DisplayUpdated' activity Id handling (after all, results screen is fetched when this activity Id is used).
…top of UIA notification event handler.
seanbudd
approved these changes
Jan 13, 2022
Contributor
Author
|
@seanbudd, ping, milestone update please i.e. when do you expect this will be merged into master. Thanks. |
feerrenrut
reviewed
Feb 15, 2022
Contributor
Author
|
Hi, yes, the indent level should be kept as we are effectively dealing with a single activity Id. Thanks.
|
feerrenrut
reviewed
Feb 15, 2022
Contributor
Author
|
Hi, will do so in the next commit. Thanks.
|
Reviewed by Reef Turner (NV Access): 'DisplayUpdated' activity Id is responsible for displaying calculator content and is updated when numbers are entered (pressing Enter and Delete key does update display content, but for purposes of handling UIA notification event, deal with number entry). Therefore add a comment that notes other activity Id's that are present but not handled in the event handler.
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 #13212
Summary of the issue:
Adds support for Windows 11 Calculator (calculatorapp.exe), consisting of an alias app module and responding to UI changes via Windows 10 Calculator app module.
Description of how this pull request fixes the issue:
In Windows 11, Calculator not only saw UI changes, but it comes with a renamed executable (calculator.exe -> calculatorapp.exe). To take care of these changes:
An alternative is a dedicated Windows 11 Calculator app module that inherits from Windows 10 Calculator's AppModule class and tweaks UIA notification event handler. Although this makes it easy to identify which app module is which, it introduces code duplication which might be an issue from maintenance point of view. Therefore, an alias app module and a tweaked base app module is more suitable for this situation.
Testing strategy:
Manual testing: requires Windows 11, make sure NVDA performs as expected while using Calculator app just as in Windows 10 (namely not nanouncing display text unless Enter/Escape/Delete is pressed, unit converter results are announced, and others).
Known issues with pull request:
None
Change log entries:
New features:
Added support for Windows 11 Calculator. (#13212)
Code Review Checklist: