Repository navigation
Fix empty automation bounds for custom root providers - #21730
Merged
Merged
Conversation
…ctangle to screen coordinates, fixing empty UIA bounds for root providers that are not ControlAutomationPeers.
MrJul
enabled auto-merge
July 8, 2026 09:48
|
You can test this PR using the following package version. |
MrJul
added this pull request to the merge queue
Jul 8, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 8, 2026
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.
What does the pull request do?
Adds
AutomationPeer.ToScreen(Rect)so each peer converts its own bounding rectangle to screen coordinates, and uses it from the Win32 UIA backend.What is the current behavior?
AutomationNode.GetBoundingRectangleonly produces bounds when the visual root peer is aControlAutomationPeerwith a liveControlowner:Any custom
IRootProviderthat is not aControlAutomationPeer(embedded/hosted trees) fails that check and every element reports an empty rectangle. The conversion also goes throughroot.Owner(the FocusRoot), whileGetBoundingRectanglereturns rects relative to the visual root, so the two disagree whenever FocusRoot is offset from the root.What is the updated/expected behavior with this PR?
Bounds are correct for any root provider. The peer converts its own rectangle in the coordinate space it was measured in, so there is no root-peer type requirement and no FocusRoot offset.
Checklist
Breaking changes
None.
ToScreenis additive and[PrivateApi].