Skip to content

Fix translate window shrinking on Windows with mixed DPI monitors#1257

Open
wyl2003 wants to merge 1 commit into
pot-app:masterfrom
wyl2003:fix/translate-window-logical-size
Open

Fix translate window shrinking on Windows with mixed DPI monitors#1257
wyl2003 wants to merge 1 commit into
pot-app:masterfrom
wyl2003:fix/translate-window-logical-size

Conversation

@wyl2003

@wyl2003 wyl2003 commented Apr 7, 2026

Copy link
Copy Markdown

What

Fix an issue where the translation window (selection translate) becomes smaller after each translation when "Remember window size" is enabled on Windows, especially with mixed-DPI multi-monitor setups (e.g. 150% + 100%).

Why

translate_window_width/height are persisted from the frontend as logical sizes (converted from outerSize() via toLogical(scaleFactor)), but the Rust window creation code restored them as physical sizes by multiplying by monitor.scale_factor() again. This unit mismatch causes size drift across resizes/opens.

How

Restore the translate window using logical units:

  • Use tauri::LogicalSize for set_size
  • Remove the extra dpi scaling on restore
  • Add a note clarifying the stored units

Updated window size setting to use logical size instead of physical size.
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