UI Automation in Windows Console: fix setEndPoint/compareEndPoints#10043
Closed
codeofdusk wants to merge 7 commits into
Closed
UI Automation in Windows Console: fix setEndPoint/compareEndPoints#10043codeofdusk wants to merge 7 commits into
codeofdusk wants to merge 7 commits into
Conversation
Contributor
Author
Collaborator
|
I see why you brought back isCollapsed. I have a small concern though.
I think it makes sense to rename _get_isCollapsed to _get_isEmpty. endPointHelper can get ifEmpty and isCollapsed can just return it. |
Contributor
Author
|
Closing to possibly work around a Github bug. Identical PR pending. |
Contributor
|
This PR does not seem to be updating from the source branch, it is missing commit |
Collaborator
|
I think that if there is a possible github bug, in most cases there are
better ways to work around them than simply closing the pull request and
opening a new one. A force push can help, for example. Same applies to
switching the base branch. In the future, could you please ask for
assistance to work around a bug rather than opening a new pr? This also
offers the benefit of finding out what went wrong in order to avoid it
in the future. Thanks a lot!
|
Contributor
|
@LeonarddeR, Bill opened a new PR at my request. I wanted to preserve the state of this PR for the Github bug report. I hadn't considered that opening a new PR would close this one. |
Collaborator
|
thanks for clarifying!
|
feerrenrut
pushed a commit
that referenced
this pull request
Aug 12, 2019
Closes #10035 Related to #9614 Identical to #10043 Works around a UIA bug on Windows 10 1803 and later that means we can not trust the "end" endpoint of a collapsed (empty) text range for comparisons. The console incorrectly reports the "end" as being past the "start" endpoint. This stops braille being able to properly track the system caret in Windows Console. Instead use getText(1) on the textRange to attempt to fetch 1 character. getText returns an empty string for a collapsed range. By definition, the "start" and "end" endpoints for a collapsed range are equivalent, thus read from the "start" endpoint of a collapsed range instead of the "end" endpoint.
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 #10035. Related to #9614.
Summary of the issue:
Braille does not properly track the system caret in Windows Console.
Description of how this pull request fixes the issue:
#9802 introduced a patched implementation of
_get_isCollapsed. As suggested by @LeonarddeR, this code has been factored out into a new_endPointHelpermethod which normalizes endPoints forcompareEndPointsandsetEndPoint(used by_get_isCollapsed, Braille support, and possibly others).Testing performed:
Tested that the
isCollapsedproperty behaves as expected (in the Python console). Testing by @LeonarddeR indicates that Braille behaves as expected after the change.Known issues with pull request:
None.
Change log entry:
None.