Skip to content

Reopen the window maximized when it was left maximized (#553) - #555

Merged
pch merged 3 commits into
mainfrom
fix/553-remember-maximized
Oct 20, 2026
Merged

pch merged 3 commits into
mainfrom
fix/553-remember-maximized

Conversation

@pch

@pch pch commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Fixes #553.

The window always opened at its default 1440×960 size; nothing about it was persisted. session.json now records whether the window was maximized, and the next launch opens it maximized.

  • Saved when the window is maximized or restored, read from egui's viewport info each frame.
  • A minimized window keeps the saved value: winit on Windows clears its maximized flag on SIZE_MINIMIZED.
  • X11 window managers ignore the creation-time maximize request because eframe keeps the window hidden until the first frame is painted. The first frame asks again, after eframe shows the window (the same timing as upstream Improve window restoration logic emilk/egui#8687's after_first_show). The state isn't saved until the window reports maximized or 2 s pass, so those first frames don't overwrite it. A window that is already maximized (Windows, Wayland) or started minimized isn't asked again.
  • Windows and Linux only. On macOS egui reads the maximized state only at launch (Incorrect maximize behaviour emilk/egui#3494), so a window zoomed back out would keep reopening zoomed.
  • Size and position are deliberately not restored.

Known limitation

On Windows a window restored maximized can flash briefly while unpainted at startup: winit maximizes the hidden window with ShowWindow(SW_MAXIMIZE), then hides it again. The upstream fix (emilk/egui#8687, cloaking the window via DWM) lives in egui-winit, and app code only gets the window after the flash has happened. It goes away when we move the crmne/egui pin to a revision that includes #8687.

Review

Codex (GPT-6.1-Sol) round 1 found the X11 problem (fixed) and the Windows flash (declined above). Round 2 was interrupted before it gave a verdict; its partial notes cleared Wayland and the deadline timing. The minimized-launch guard was added after it.

Not tested on Windows: no machine available.

Checks

  • Tests the_window_reopens_maximized_as_it_was_left and a_window_reopened_maximized_keeps_that_until_the_window_manager_maximizes_it; each fails without the behaviour it covers.
  • cargo fmt --check and cargo clippy --workspace --all-targets --locked -- -D warnings pass.
  • cargo test --workspace --locked --no-fail-fast: all pass except rawmakase-decode chart_dng_fingerprint_is_pinned, which fails locally because this machine has lens profiles installed; unrelated.

🤖 Generated with Claude Code

The window always opened at its default size. The session now records
whether it was maximized, saved when it is maximized or restored, and
opens it that way again. A minimized window keeps what it was: Windows
reports it as not maximized. Not on macOS, where egui reads the state
only at launch (emilk/egui#3494).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-20T07:08:16.080772Z 62d3496 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

pch and others added 2 commits October 20, 2026 09:18
X11 window managers ignore a maximize request for a window that is not
mapped yet, and eframe keeps the window hidden until the first frame is
painted, so the window reopened unmaximized and that was saved. The
first frame asks again, after eframe shows the window, and the state is
not saved until the window is maximized or two seconds pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A window started minimized (a shortcut set to Run: Minimized) would have
been restored by the request; one already maximized needs none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pch
pch merged commit 151f996 into main Oct 20, 2026
13 of 14 checks passed
@pch
pch deleted the fix/553-remember-maximized branch November 2, 2026 09:21
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.

RAWmakase Windows does not remember it's state. ( Does not remember it's Maximized )

1 participant