Skip to content

fix(desktop): persist window size and position - #6978

Draft
ComputelessComputer wants to merge 1 commit into
mainfrom
cursor/persist-window-size-position-f861
Draft

fix(desktop): persist window size and position#6978
ComputelessComputer wants to merge 1 commit into
mainfrom
cursor/persist-window-size-position-f861

Conversation

@ComputelessComputer

Copy link
Copy Markdown
Collaborator

Joey reported that the app forgets window size and position on almost every launch, and also jumps when going from a meeting to Settings. 1.4.11 only stopped recentering after updates, so the frame still reset.

Cause

tauri-plugin-window-state keeps the saved frame in an in-memory cache. The main window was created, then immediately forced to 910×600, and the plugin’s resize listener wrote that default over the saved frame before restore ran. Re-showing an already-open window (tray, floating bar, Settings) applied that stale frame again. Leaving a meeting also restored temporary chat-panel width expansions even when chat was still open.

Fix

  • Use 910×600 as the builder default only (first launch), and restore size, position, and maximized on create before any later resize can clobber the cache.
  • Do not re-apply saved state when showing an existing window; keep the live geometry.
  • Save size, position, and maximized on quit (not size-only).
  • Restore temporary width expansions when docked chat actually closes, not when switching from a meeting to Settings.

Testing

  • pnpm -F desktop test src/shared/main/chat-panels.test.tsx
  • pnpm -F desktop typecheck
  • pnpm exec oxlint --quiet --format=github apps/desktop/src/shared/main/chat-panels.tsx apps/desktop/src/shared/main/chat-panels.test.tsx

cargo test -p tauri-plugin-windows could not run here (GTK gdk-3.0.pc is not installed in this environment).

Open in Web Open in Cursor 

The default 910x600 size was applied after window creation, which
overwrote the saved frame before restore. Showing an already-open
window also reapplied that stale state, so opening Settings from a
meeting jumped the frame.

Restore size, position, and maximized on create, keep live geometry
when showing an existing window, and stop shrinking the window just
because the user left a meeting view.

Co-authored-by: John Jeong <ComputelessComputer@users.noreply.github.com>
@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for anarlog canceled.

Name Link
🔨 Latest commit 70c62cb
🔍 Latest deploy log https://app.netlify.com/projects/anarlog/deploys/6a8741367d70530008caddcd

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.

2 participants