Skip to content

Start the window where the last run left it [patch] - #525

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/523-restore-window-state
Nov 4, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/523-restore-window-state

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

WindowResized saves ImGuiApp.WindowState to Options.WindowState every time the window moves or resizes. BuildConfig never passed that state back, so every launch opened at the default 1280x720, in the default position and not maximized.

Change

  • BuildConfig now sets InitialWindowState = Options.WindowState. Both constructors load or receive the options before Main calls BuildConfig, so this is the state the previous run saved.
  • Not included: clamping a saved position that is no longer on any monitor. The issue listed it as "consider", and it needs monitor enumeration that ImGuiApp doesn't expose at config time. It can follow separately if it turns out to be needed.

Tests

  • New: WindowStateTests.BuildConfig_StartsTheWindowWhereTheSavedOptionsLeftIt. It checks that a saved size, position and Maximized layout all come through InitialWindowState. It fails on main (size mismatch) and passes with this change.
  • UI tests: 8 of 8 pass. The gallery still renders at the harness size.
  • ProjectDirector.Test: 178 pass, 1 skipped, 1 failed. The failure is CloningAnLfsRepositoryRestoresTheFileContentRatherThanThePointer, and it fails the same way on main in this environment, so it is unrelated.

Fixes #523


Generated by Claude Code

WindowResized saved the window's size, position and layout to the options on
every move or resize, but BuildConfig never passed them back, so every launch
opened at the default 1280x720. BuildConfig now starts the window from the
saved state.

Fixes #523

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW5JsJWSEGD7D4Jhs1d
@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 3c3fdbf into main Nov 4, 2026
16 checks passed
@matt-edmondson
matt-edmondson deleted the fix/523-restore-window-state branch November 4, 2026 01:02
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.

Window size, position and maximized state are saved on every move/resize but never restored: every launch opens at 1280x720

2 participants