Skip to content

Restore window geometry when AetherSDR launches in Minimal Mode (#2483). Principle XIV.#3174

Merged
ten9876 merged 1 commit into
mainfrom
aetherclaude/issue-2483
May 26, 2026
Merged

Restore window geometry when AetherSDR launches in Minimal Mode (#2483). Principle XIV.#3174
ten9876 merged 1 commit into
mainfrom
aetherclaude/issue-2483

Conversation

@aethersdr-agent

Copy link
Copy Markdown
Contributor

Summary

Fixes #2483

What was changed

Restore window geometry when AetherSDR launches in Minimal Mode (#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)


🤖 aethersdr-agent · cost: $6.0862 · model: claude-opus-4-7

…. 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>

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • closeEvent refresh of MinimalModeGeometry correctly mirrors the abnormal-state guard from toggleMinimalMode(false) at MainWindow.cpp:13622-13627.
  • Restore order (geometry → state → minimal mode → aetherial strip) matches what the comment block explains.
  • Uses AppSettings and 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

@ten9876 ten9876 merged commit d2b82f7 into main May 26, 2026
5 checks passed
@ten9876 ten9876 deleted the aetherclaude/issue-2483 branch May 26, 2026 05:17
G6PWY-Chris pushed a commit to G6PWY-Chris/AetherSDR that referenced this pull request Jun 22, 2026
…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>
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.

When AetherSDR is placed in minimal mode, it will not restore window geometry at startup

1 participant