Repository navigation
fix(windows): use continuous physical desktop coordinates - #439
Merged
Merged
Conversation
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.
Problem and behavior
Windows' origin-preserving logical mapping shrinks each monitor's extent while retaining its physical origin. A window crossing adjacent 200% displays can have logical bounds x=1900..3920 although its actual physical frame is x=3800..4000. Its calculated center falls into an artificial coordinate gap, and pointer input can land outside the window.
Windows now exposes physical desktop pixels consistently for UIA bounds, pointer coordinates, window move/resize, and screenshot regions. A seam-spanning window has continuous bounds; its center and width are ordinary rectangle arithmetic. The Windows screenshot scale hint is 1.0. Capture mappings use identity segments clipped to each display, so holes and offscreen pixels stay unmapped. Display geometry changes still invalidate a capture's mapping.
Breaking coordinate change
This changes Windows values previously reported as DIPs. Consumers with stored Windows coordinates must convert them to physical desktop pixels. Coordinates obtained from
Element.bounds, screenshot mapping, CLI output, or bindings can be fed back into input, window actions, and capture regions without conversion. macOS and Linux retain their existing units.Validation
cargo test -p xa11y-core -p xa11y-windows --libpassed (292 core and 81 Windows tests). New cases cover equal-DPI seam centers, negative origins, screenshot round trips, layout holes, and offscreen rejection.cargo xtask checkpassed formatting, lint, Rust tests, binding parity, Python tests (324 passed, 2 skipped), JS tests (152 passed), harness tests, and Strands tests (254 passed). The overall command failed in five pre-existing Windows-local pytest-xa11y process timing/CRLF tests (115 passed), as recorded in the release review.PYTHONUTF8=1.SendInputwith Windows error 5, so the ignored wire test cannot run here.