Skip to content

fix(windows): use continuous physical desktop coordinates - #439

Merged
crowecawcaw merged 3 commits into
mainfrom
fix/windows-continuous-desktop-coordinates
Sep 19, 2026
Merged

crowecawcaw merged 3 commits into
mainfrom
fix/windows-continuous-desktop-coordinates

Conversation

@crowecawcaw

@crowecawcaw crowecawcaw commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

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

  • After merging main (Fix process scope, screenshot transforms, and Windows JS test discovery #438), cargo test -p xa11y-core -p xa11y-windows --lib passed (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 check passed 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.
  • Docs page-type, table, and link checks passed with PYTHONUTF8=1.
  • Live Windows move/resize and input paths are covered by hosted CI suites. This local session rejected SendInput with Windows error 5, so the ignored wire test cannot run here.

@crowecawcaw
crowecawcaw marked this pull request as ready for review September 19, 2026 02:34
@crowecawcaw
crowecawcaw merged commit a7dd495 into main Sep 19, 2026
38 checks passed
@crowecawcaw
crowecawcaw deleted the fix/windows-continuous-desktop-coordinates branch September 19, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant