Add Windows Compatibility Layer#245
Open
Solez-ai wants to merge 2 commits into
Open
Conversation
- Per-monitor DPI awareness support - Multi-monitor coordinate translation - Self-calibrating mouse system - Debug overlay for accuracy testing - Resolves coordinate drift on Windows with DPI scaling
feat: add Windows compatibility layer for improved coordinate accuracy
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.
Summary
This PR adds a Windows Compatibility Layer (
ui_tars/windows_runtime/) that solves coordinate translation failures on Windows systems with DPI scaling and multi-monitor configurations. It directly addresses the #1 user complaint: "Windows automation fails compared to Linux."Problem
When AI GUI agents like UI-TARS predict click coordinates:
The issue: Windows has multiple coordinate systems (logical, physical) that differ at non-100% DPI. At 150% scaling:
AI predicts in logical space, but Windows interprets coordinates differently depending on DPI settings and monitor configuration. This creates offset errors that break automation.
Additionally:
Most repos don't handle this properly - including UI-TARS.
Solution
A complete Windows translation engine:
1. Per-Monitor DPI Awareness (
dpi.py)2. Multi-Monitor Detection (
monitor_manager.py)3. Coordinate Translation Pipeline (
coordinate_mapper.py)4. Self-Calibrating Mouse (
calibration.py,cursor_tracker.py)5. Debug Overlay for Testing (
overlay_debugger.py)Files Added
Why This Should Be Merged
Testing
All tests pass including:
Usage Example
This is a production-ready contribution that transforms UI-TARS from "barely works on Windows" to "reliably accurate on any Windows configuration."