Skip to content

fix(window-state): convert macOS coordinates to Logical to fix overlay shrink and multi-monitor DPI scaling drift#3416

Open
gkucmierz wants to merge 2 commits into
tauri-apps:v2from
gkucmierz:fix/macos-logical-coordinates
Open

fix(window-state): convert macOS coordinates to Logical to fix overlay shrink and multi-monitor DPI scaling drift#3416
gkucmierz wants to merge 2 commits into
tauri-apps:v2from
gkucmierz:fix/macos-logical-coordinates

Conversation

@gkucmierz
Copy link
Copy Markdown

Description

Fixes a longstanding issue on macOS where the window physically shrinks and drifts across the screen on every restart or multi-monitor movement when using titleBarStyle: Overlay or Transparent.

Changes

  1. Converted the internal state coordinates inside update_state, restore_state, and event handlers from Physical to Logical. Saving physical coordinates causes severe positional and scale drift when moving windows between monitors of different DPIs (e.g., dragging from a Retina 2x display to an external 1x 1080p display).
  2. Added a macOS-specific heuristic during the SIZE cache update. When an Overlay titlebar causes the inner_size to report 28px smaller than the outer_size, the plugin now correctly caches the outer dimensions to prevent cascading shrinkage on subsequent launches.
    This patch comprehensively stabilizes window boundaries and restoration logic across complex macOS multi-monitor setups.

…y shrink and multi-monitor DPI scaling drift
@gkucmierz gkucmierz requested a review from a team as a code owner May 9, 2026 07:26
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