Restore window geometry when AetherSDR launches in Minimal Mode (#2483). Principle XIV.#3174
Conversation
…. Principle XIV. Two changes in src/gui/MainWindow.cpp: 1. closeEvent now refreshes MinimalModeGeometry when quitting from Minimal Mode (guarded against maximized/fullscreen abnormal state to match toggleMinimalMode(false)). Previously the per-mode key was only written by toggleMinimalMode(false), so users who launched in Minimal Mode and quit without ever toggling out never updated it. 2. The constructor's auto-enter-minimal-mode and AetherialStrip restore blocks have moved from L1641-1648 to immediately after the geometry restore at L4847. The earlier call site caused toggleMinimalMode(true) to snapshot the default startup rect into FullModeGeometry (corrupting the previous session's saved rect) and to restoreGeometry(MinimalModeGeometry) against a window not yet placed on the correct screen. User report: drift only visible with FramelessWindowHint on Windows because native chrome lets the WM cache pos() and partially compensate for the missing per-mode save; Frameless removes that safety net so the bug surfaces. Fix addresses the root cause (no MinimalModeGeometry save on close + wrong-order restore on open), making position stable in both chrome modes. Risk note: the reorder preserves the m_enteringMinimalMode guard inside toggleMinimalMode (L13528/L13576) that hardens the macOS AppKit-deferred WindowStateChange path from #2367. Persisting MinimalModeGeometry inline alongside MainWindowGeometry keeps the per-mode key fresh atomically with the rest of the close- event state (Principle XIV: persist atomically — the AppSettings save() at end of closeEvent commits the full updated state in one shot, never partially). Blast radius: risk_score=0.358, 12 high-risk affected (top: AppSettings::instance, ThemeManager::instance, ThemeManager::applyStyleSheet). The downstream surface is the existing AppSettings/RadioModel calls closeEvent already makes; this commit adds one more setValue and a reordering, no new structural edges. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Thanks for the fix — the diagnosis in the comments matches what I see in toggleMinimalMode(). Two notes, one is a real concern worth a follow-up.
Concern: FullModeGeometry gets overwritten at startup
When the new constructor path calls toggleMinimalMode(true) at MainWindow.cpp:4857, the first thing that runs inside is:
s.setValue("FullModeGeometry", saveGeometry().toBase64());At this point saveGeometry() returns the rect we just restored from MainWindowGeometry, which for a session that exited in minimal mode is the minimal-mode rect (260px wide). So a user who launches into minimal mode and then hits Ctrl+M to go back to full mode now restores a 260-px-wide window at the minimal position — FullModeGeometry from any prior deliberate enter is gone.
This isn't strictly a regression (the old early-call corrupted FullModeGeometry with the startup default rect, which is also wrong), and it's adjacent to what #2483 was reporting. But the move makes it easy to fix in the same area — e.g. read both FullModeGeometry and MinimalModeGeometry from settings during the startup branch and apply them directly, rather than routing through toggleMinimalMode(true)'s snapshot-then-restore. Or guard the FullModeGeometry snapshot inside toggleMinimalMode with a "startup restore" flag.
Minor: rest of the change reads correctly
closeEventrefresh ofMinimalModeGeometrycorrectly mirrors the abnormal-state guard fromtoggleMinimalMode(false)at MainWindow.cpp:13622-13627.- Restore order (geometry → state → minimal mode → aetherial strip) matches what the comment block explains.
- Uses
AppSettingsand matches surrounding conventions; only the stated file changed.
If you want to fold the FullModeGeometry fix into this PR or split it into a follow-up tracking #2483's adjacent symptom, either works — flagging so it doesn't get lost.
🤖 aethersdr-agent · cost: $7.7915 · model: claude-opus-4-7
…ersdr#2483). Principle XIV. (aethersdr#3174) ## Summary Fixes aethersdr#2483 ### What was changed Restore window geometry when AetherSDR launches in Minimal Mode (aethersdr#2483). Principle XIV. ### Files modified - `src/gui/MainWindow.cpp` ``` src/gui/MainWindow.cpp | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) ``` --- Generated by AetherClaude (automated agent for AetherSDR) --- <sub>🤖 aethersdr-agent · cost: $6.0862 · model: claude-opus-4-7</sub> Co-authored-by: aethersdr-agent[bot] <273844287+aethersdr-agent[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Fixes #2483
What was changed
Restore window geometry when AetherSDR launches in Minimal Mode (#2483). Principle XIV.
Files modified
src/gui/MainWindow.cppGenerated by AetherClaude (automated agent for AetherSDR)
🤖 aethersdr-agent · cost: $6.0862 · model: claude-opus-4-7