Skip to content

fix(electron): persist macOS zoom and window bounds across reopen#530

Open
passion729 wants to merge 2 commits intolukilabs:mainfrom
passion729:fix-macos-window-zoom-persistence
Open

fix(electron): persist macOS zoom and window bounds across reopen#530
passion729 wants to merge 2 commits intolukilabs:mainfrom
passion729:fix-macos-window-zoom-persistence

Conversation

@passion729
Copy link
Copy Markdown

@passion729 passion729 commented Apr 12, 2026

Summary

Fixes macOS window state persistence issues when reopening the app window without fully quitting.

This PR now covers:

  • zoom persistence across close/reopen
  • window bounds (size and position) persistence across close/reopen

Fixes #529

Changes

  • Persist window zoom factor in app config (windowZoomFactor)
  • Apply persisted zoom on window creation and after initial renderer load
  • Persist zoom on webContents zoom change events
  • Add close-time fallback persistence for zoom on window close
  • Capture last-closed window snapshot in WindowManager (workspace, bounds, focused, url)
  • On macOS app.activate (Dock reopen with no windows), restore from last-closed/saved window state instead of default window size
  • During before-quit, avoid saving an empty window list when all windows were already closed by reusing last-closed window state

Testing

  • Manual (macOS):
    1. Open app
    2. Change zoom (Cmd + / Cmd -)
    3. Resize and move window
    4. Close window (Cmd + W / traffic-light close), do not quit app
    5. Reopen from Dock
    6. Verify both zoom and window bounds are preserved
  • Verification:
    • bun run typecheck:shared
    • bun run typecheck:electron

@passion729 passion729 changed the title fix(electron): persist zoom across window reopen on macOS fix(electron): persist macOS zoom and window bounds across reopen Apr 13, 2026
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.

macOS: Zoom level resets when reopening window without quitting app

1 participant