Skip to content

Floating state persistence + insertChildWidget guard#2065

Merged
ten9876 merged 1 commit into
mainfrom
auto/ContainerWidgetinsertChildWidget--no-op-for-alread
Apr 27, 2026
Merged

Floating state persistence + insertChildWidget guard#2065
ten9876 merged 1 commit into
mainfrom
auto/ContainerWidgetinsertChildWidget--no-op-for-alread

Conversation

@ten9876

@ten9876 ten9876 commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Combines two changes:

1. Cherry-picked persistence fix (originally #2057, by @chibondking)

PanadapterStack::saveFloatingState/restoreFloatingState for popped-out panadapters and ContainerManager::saveState() in prepareShutdown for popped-out applet containers, plus MainWindow calls to restore both at launch. PR #2057 was based on a stale main; cherry-picked the four-file diff onto current main and verified clean.

2. ContainerWidget::insertChildWidget guard

While testing #1 on top of current main, the Aetherial Audio container's CHAIN widget displaced from index 0 down to the bottom of the layout. Root cause: ContainerManager::saveState() skips non-ContainerWidget children (line 337 qobject_cast<ContainerWidget*>(w)), so ClientChainApplet (a plain QWidget) is silently omitted from the saved children list. Then restoreState()'s second pass calls insertChildWidget(i, child) for each saved child at indices 0..N-1; Qt's insertWidget on a widget already in the layout moves it, shifting CHAIN further down each iteration.

Fix: insertChildWidget no-ops when the child is already in this layout. AppletPanel populates children once at construction; restoreState's re-add was the bug. Drag-reorder of chain stages is unaffected because that path does removeChildWidget first.

Closes #2057

Closing in favour of this combined PR. Thanks @chibondking for the persistence work — the cherry-pick applied cleanly and your design is solid; we just hit a latent bug in the existing ContainerManager API that #2057 was the first thing to exercise.

Co-Authored-By: CJ Johnson cj@cedrick.io

- [fix] Floating panadapter and applet state not restored across restarts
- ContainerWidget::insertChildWidget — no-op for already-present children
@ten9876 ten9876 enabled auto-merge (squash) April 27, 2026 00:06
@ten9876 ten9876 requested a review from jensenpat as a code owner April 27, 2026 00:06
@ten9876 ten9876 changed the title ContainerWidget::insertChildWidget — no-op for already-present children Floating state persistence + insertChildWidget guard Apr 27, 2026
@ten9876 ten9876 merged commit 73b4fe8 into main Apr 27, 2026
4 checks passed
@ten9876 ten9876 deleted the auto/ContainerWidgetinsertChildWidget--no-op-for-alread branch April 27, 2026 00:13
ten9876 added a commit that referenced this pull request Apr 27, 2026
…2067)

Originally by @chibondking — propagates View → Frameless Window setting
to all popped-out panadapters and applet containers, instead of leaving
them with hardcoded Qt::FramelessWindowHint.

- PanFloatingWindow / FloatingContainerWindow constructors now read
  AppSettings["FramelessWindow"] instead of hardcoding the flag.
- New setFramelessMode(bool) on both window classes flips the flag at
  runtime, preserving geometry + visibility.
- PanadapterStack::setFramelessMode and ContainerManager::setFramelessMode
  iterate live floating windows and propagate the toggle.
- MainWindow::setFramelessWindow calls into both managers.

Resolved one trivial conflict in PanadapterStack.h where the new
setFramelessMode declaration overlapped with the saveFloatingState/
restoreFloatingState block from #2065.

Closes #2059.

Co-authored-by: CJ Johnson <cj@cedrick.io>
Co-authored-by: Claude Opus 4.7 (1M context) <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.

1 participant