Skip to content

fix(window): correct oversized window at >100% scaling + add Maintenance recovery controls#337

Merged
lshw54 merged 2 commits into
codefrom
fix/window-dpi-oversize
Jul 10, 2026
Merged

fix(window): correct oversized window at >100% scaling + add Maintenance recovery controls#337
lshw54 merged 2 commits into
codefrom
fix/window-dpi-oversize

Conversation

@lshw54

@lshw54 lshw54 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What

Two window issues reported on 6.0.4, both surviving app updates because they
stem from persisted / runtime state rather than the app bundle:

Fix

  • Drop the leftover --force-device-scale-factor=1 so the webview
    devicePixelRatio follows the OS scale. LogicalSize and fitWindow's
    CSS-px measurements (which already assume screen.availWidth is CSS px) then
    agree, and the window matches its content at every scaling. Keep
    --force-text-scale-factor=1 (an orthogonal accessibility guard).
  • Add a Settings -> Maintenance section with two recovery controls:
    • Reset window positionsystem::reset_window_position re-centers the
      OS window and deletes the persisted .window-state.json.
    • Clear WebView2 cachesystem::clear_webview2_cache clears the main
      webview's browsing data (including the persisted zoom that can mis-size the
      window). Confirmed first; does not sign the user out (the login session
      lives in the backend HTTP client's cookie jar, not the webview).
    • The new commands regenerate bindings.ts; i18n keys added to all three
      locales.

Notes for reviewers

  • Rust clippy + 766 unit tests, and frontend typecheck / prettier / eslint /
    vitest (629) + production build all pass.
  • The DPI behavior and the two buttons need on-device verification across
    100–200% Windows scaling — there's no scaled display in CI, so this couldn't
    be exercised automatically.

lshw54 added 2 commits July 11, 2026 02:08
…w matches content at >100% scaling

#257 forced the webview to 1:1 physical pixels for its physical-px layout, but
#326 switched the router's fitWindow to size the OS window with LogicalSize
(Tauri multiplies logical px by the OS scale factor). With the webview still
rendering 1:1, at >100% Windows scaling the window came out scale-times larger
than the content -> the 'window too big, empty space around it' bug. Let the
webview devicePixelRatio follow the OS scale so LogicalSize and fitWindow's
CSS-px measurements agree and the window matches content at every scaling.
Keep --force-text-scale-factor=1 (orthogonal accessibility guard).
…ar WebView2 cache

Adds a Settings -> Maintenance section with two recovery controls for the
'window too big / empty space / off-screen' reports:

- Reset window position: re-centers the OS window and deletes the persisted
  tauri-plugin-window-state position (POSITION-only), fixing a window stranded
  off-screen or at a bad spot.
- Clear WebView2 cache: clears the main webview's browsing data (incl. the
  persisted zoom that can mis-size the window). Confirmed first; does NOT sign
  the user out (the session lives in the backend HTTP client, not the webview).

Backend: system::reset_window_position + system::clear_webview2_cache commands
(bindings.ts regenerated). i18n keys added to all three locales.
@lshw54
lshw54 merged commit 82fef7e into code Jul 10, 2026
3 checks passed
@lshw54
lshw54 deleted the fix/window-dpi-oversize branch July 10, 2026 18:54
lshw54 added a commit that referenced this pull request Jul 12, 2026
…resizer (#339) (#341)

Windows Accessibility 'Text size' >= 130% clipped the app: #337's
'--force-text-scale-factor=1' is not a real Chromium switch and was
silently ignored. WebView2 rasterizes at monitor-DPI x text-scale
(surfaced as devicePixelRatio) while Tauri LogicalSize only applies
monitor DPI, so content painted 1.3x larger than the window at 130%.
Fix: derive textScale = devicePixelRatio / (scaleFactor x appliedZoom)
at runtime and multiply it into every LogicalSize the resizer emits —
big text stays big, the window grows to fit, and text size 100% keeps
byte-identical #337 display-scaling behaviour. Drop the fictional flag
from lib.rs. 10 new vitest specs; 639 tests + cargo check/clippy pass.
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