UI Automation in Windows Console: work around Microsoft bugs on Windows 10 version 1903 and improve caret movement#9773
Merged
michaelDCurran merged 5 commits intonvaccess:masterfrom Jun 21, 2019
Conversation
Collaborator
|
Does this partially implement #9660? |
Contributor
Author
Yes – we now listen for |
michaelDCurran
requested changes
Jun 21, 2019
Member
michaelDCurran
left a comment
There was a problem hiding this comment.
In the Edge address bar, pressing backspace now fails to announce the deleted character.
- Please move the
__ne__method onto ConsoleUIATextInfo - Please only multiply caretMovementTimeout on WinConsoleUIA NVDAObject.
We do of course want to try and fix this for UIA in general at some point in the future, but due to the introduced bug, clearly for now this solution is only useful for consoles.
Contributor
Author
@michaelDCurran Fixed. |
michaelDCurran
requested changes
Jun 21, 2019
michaelDCurran
approved these changes
Jun 21, 2019
Closed
feerrenrut
pushed a commit
that referenced
this pull request
Jul 24, 2019
## Summary of the issue: In text fields, when moving the caret with caret movement commands, such as the arrows, NVDA relies on bookmarks to find out whether the caret has moved. In short: 1. You press left arrow 2. NVDA creates a bookmark of the current caret position 3. NVDA executes left arrow 4. For up to the caret movement timeout, NVDA tries to find out whether the caret has moved by creating new bookmarks and comparing them against the old. However, for UIA, this comparison fails, as creating a bookmark at the end of a range and then removing one character from the end of the range results in a new bookmark that is equal to the former. ## Description of how this fixes the issue: This PR introduces a different approach based on #9773. In first instance, this code caused #9786 to occur (i.e. editors in Chrome reporting the wrong caret position). Compared to #9773, flow is now as follows: - In a loop in EditableText._hasCaretMoved, NVDA processes pedning events - If there is a focus event pending, the loop is exited - NVDA tries to find out whether the caret position has changed by creating a textInfo at the caret position - new code: only when this succeeds, NVDA checks for pending caret and textChange events. If the object that contains the caret has caretMovementDetectionUsesEvents set to False, it still ignores the caret events. This is what we do in IA2Web objects. ## Testing performed: - Tested that deleted characters/words are again reported in UIA controls, such as MS Word - Tested Notepad, Wordpad, Word Without UIA, Thunderbird, LibreOffice, start menu edit field, legacy command consoles and Skype Electron. Made sure that the caret was still correctly reported in all of them when moving with arrow keys or deleting. ## Known issues with pull request: We can't set the caretMovementDetectionUsesEvents attribute to True on editableText.EditableText and then override it in other places, such as IA2Web. This is because EditableText precedes the IA2Web class as well as other classes in the mro Setting it on EditableText directly therefore makes it impossible for other classes to override the attribute. I solved this by making it a magic property on EditableText that first tries to call super before returning the default. Fixes #9928 Follow up of PR #9773
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 #9632 and #9649. Builds on #9614. Incorporates #5991 with modifications.
Summary of the issue:
Currently:
collapsemethod onconsoleUIATextInfois broken, resulting in several caret and selection bugs.Description of how this pull request fixes the issue:
consoleUIATextInfo.collapseandconsoleUIATextInfo._get_isCollapsedas suggested by @michaelDCurran.caretevent for UIA._caretMovementTimeoutMultipliervariable to editable text objects, and sets it to 2 for UIA (some controls take a while to send events).Testing performed:
Tested the console and Windows start menu search field on Windows 10 1903. Caret movement, selection, and backspace reporting are functional, even over
ssh.Known issues with pull request:
Change log entry:
None