Repository navigation
Address code review points from #4 - #7
Merged
Merged
Conversation
Compare window handles rather than objects when deciding whether the walk has reached the top-level window: an add-on that puts overlay classes on the desktop object makes the identity comparison fail. Guard against a missing parent, which the old comparison tolerated silently. Replace POSITION_FIRST plus expand(UNIT_STORY) with POSITION_ALL at every capture site, and drop the 0x7fffffff line move that did the same thing for the display-model path. Equivalent for both the offsets and UIA backends. Reported by @Emil-18 in #4. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Addresses three of the four points @Emil-18 raised in #4.
Window handle comparison.
parent.simpleParent == desktopcompared objects, so an add-on that adds overlay classes to the desktop object breaks the check and the walk never stops at the top-level window. Now compareswindowHandle, with aNoneguard —simpleParentcan beNone, which the old comparison tolerated silently but attribute access would not.POSITION_ALL. Five sites collapse
makeTextInfo(POSITION_FIRST)+expand(UNIT_STORY)intomakeTextInfo(POSITION_ALL), and the display-model path drops the0x7fffffffline move that achieved the same thing.Checked against NVDA source rather than assumed:
textInfos/offsets.pysetsstart=0, end=_getStoryLength()forPOSITION_ALL, andNVDAObjects/UIAreturnsUIATextPattern.documentRange, which is whatExpandToEnclosingUnit(Document)produces. Equivalent for both backends, which matters as three of these sites are the UIATermControl.Not done here: the suggestion to check whether the foreground object has display text and fall back to
obtainUWPWindowText. That reshapes the branch dispatch rather than cleaning it up, and it interacts with the TermControl branch from #5. Left for a separate change, so #4 stays open.Smoke tested as a
devbuild in a running NVDA across Windows Terminal, a Win32 window, and a UWP window.