Skip to content

fix(desktop): avoid native HiDPI double scaling - #47

Merged
Luhaozhu merged 1 commit into
mainfrom
agent/fix-macos-retina-zoom
Jul 31, 2026
Merged

fix(desktop): avoid native HiDPI double scaling#47
Luhaozhu merged 1 commit into
mainfrom
agent/fix-macos-retina-zoom

Conversation

@Luhaozhu

@Luhaozhu Luhaozhu commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What changed

  • keep the adaptive DPI compensation for Windows WebView2
  • use page zoom 1.0 for native macOS and Linux WebViews
  • cover both Windows compensation and native HiDPI behavior with focused unit tests

Root cause

The desktop shell forces the WebView2 device scale factor to 1 to avoid fractional-DPI popup positioning issues on Windows, then restores the intended size with set_zoom. That compensation was applied on every platform. Native macOS and Linux WebViews already honor the system scale factor, so Retina/HiDPI displays received a second page zoom. On a 3024x1964 Retina display this produced approximately 1.18x scaling.

Impact

macOS and Linux now rely on their native HiDPI rendering, reducing the oversized desktop UI without changing web frontend CSS. Windows keeps its existing high-DPI and remote-desktop behavior.

Validation

  • rustfmt --edition 2021 --config skip_children=true --check desktop/src-tauri/src/lib.rs
  • focused upstream Rust suite: 4 display scaling tests passed
  • Desktop CI: scripts plus Linux, Windows, macOS Apple Silicon, and macOS Intel offline cold-start jobs passed
  • Desktop Release rebuild: all four platform packages built and uploaded successfully
  • Desktop 0.2.8 draft release contains both aarch64 and x64 macOS DMGs

@Luhaozhu
Luhaozhu marked this pull request as ready for review July 31, 2026 16:26
@Luhaozhu
Luhaozhu merged commit 3de6c7a into main Jul 31, 2026
10 checks passed
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