Skip to content

fix: close all floating windows when main window closes#1920

Merged
ten9876 merged 1 commit intoten9876:mainfrom
chibondking:fix/close-floating-windows-on-exit
Apr 25, 2026
Merged

fix: close all floating windows when main window closes#1920
ten9876 merged 1 commit intoten9876:mainfrom
chibondking:fix/close-floating-windows-on-exit

Conversation

@chibondking
Copy link
Copy Markdown
Collaborator

Closing the main window left popped-out panadapter and applet windows alive, keeping the Qt event loop running. The app only exited when the user manually closed a floating pan window.

Root cause: PanadapterStack::prepareShutdown() set the shutdown flag and saved geometry on each PanFloatingWindow but never called close(). Those windows are top-level widgets with WA_QuitOnClose=true (Qt default), so they kept the app alive. FloatingContainerWindow (applet containers) had no shutdown guard, so its closeEvent would emit dockRequested into an already-torn-down panel during teardown.

Changes:

PanadapterStack::prepareShutdown(): call fw->close() after setting the shutdown flag so floating pan windows are actually dismissed.

FloatingContainerWindow: add m_shuttingDown member and prepareShutdown() method that flushes geometry, sets the flag, and calls close(). closeEvent() now short-circuits on the flag instead of emitting dockRequested when the panel is gone.

ContainerManager: add prepareShutdown() that calls prepareShutdown() on each FloatingContainerWindow and clears the floating windows map.

MainWindow::closeEvent(): call m_appletPanel->containerManager()->
prepareShutdown() alongside the existing m_panStack->prepareShutdown() call so all floating applet containers are closed cleanly before settings are saved and the radio disconnects.

Closing the main window left popped-out panadapter and applet windows
alive, keeping the Qt event loop running. The app only exited when the
user manually closed a floating pan window.

Root cause: PanadapterStack::prepareShutdown() set the shutdown flag and
saved geometry on each PanFloatingWindow but never called close(). Those
windows are top-level widgets with WA_QuitOnClose=true (Qt default), so
they kept the app alive. FloatingContainerWindow (applet containers) had
no shutdown guard, so its closeEvent would emit dockRequested into an
already-torn-down panel during teardown.

Changes:

PanadapterStack::prepareShutdown(): call fw->close() after setting the
shutdown flag so floating pan windows are actually dismissed.

FloatingContainerWindow: add m_shuttingDown member and prepareShutdown()
method that flushes geometry, sets the flag, and calls close().
closeEvent() now short-circuits on the flag instead of emitting
dockRequested when the panel is gone.

ContainerManager: add prepareShutdown() that calls prepareShutdown() on
each FloatingContainerWindow and clears the floating windows map.

MainWindow::closeEvent(): call m_appletPanel->containerManager()->
prepareShutdown() alongside the existing m_panStack->prepareShutdown()
call so all floating applet containers are closed cleanly before
settings are saved and the radio disconnects.
@chibondking chibondking requested a review from ten9876 as a code owner April 25, 2026 04:29
@ten9876 ten9876 merged commit c482856 into ten9876:main Apr 25, 2026
5 checks passed
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.

2 participants