Quit while the window is hidden or minimized shows nothing: the only shutdown notice is pushed into the window that stays hidden #1126

Open
opened 2026-11-13 15:11:42 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-11-13 15:11:42 +00:00 (Migrated from github.com)

When the app is asked to quit while its main window is hidden or minimized, its only shutdown notice, the page "Saving... / Do not shut down the computer until this is done.", is pushed into that window, and the window stays hidden or minimized until the process exits. The shutdown itself is normal.

To reproduce:

  1. Open a wallet and wait until the app is idle.
  2. Hide or minimize the main window. I used the window's own hide() and showMinimized(), the calls that the tray's Hide and Window → Minimize make.
  3. Send the application quit event, or SIGTERM, without showing the window again.

The window's state by Qt, sampled from the quit until the process was gone:

Window at the quit State until exit Samples
Hidden Hidden; the shutdown page was its current page in 30 of the samples 33 of 33, 8 launches
Minimized Minimized; the shutdown page was its current page in all of them 39 of 39, 7 launches
On screen (control) Windowed, showing the shutdown page 16 of 17, 7 launches

The other 3 hidden samples and the one other control sample were taken before the app had noticed a SIGTERM; the last sample of every hidden launch had the shutdown page. All 22 launches exited 0 with Shutdown done. Four launches at eed1f426fcb6 gave the same states.

The shutdown handler clears the page stack and pushes the page. It does not show or raise the window:

github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/pages/MainWindow.qml (L310-L314)

By the source nothing else announces a shutdown: there is no second window, the tray tooltip and menu do not change, and there is no Dock badge or notification. Bitcoin-Qt, by its source, hides every window and opens a separate shutdown window in the same step, whatever state the main window was in (bitcoin.cpp#L329-L341).

Suggested: show and raise the window in that handler, or use a separate small window as Bitcoin-Qt does. This is the same handler as in #1116.

This is a missing notice, not a failure. A user who quits from the tray or the Dock with the window out of sight gets no word from the app that the node is still saving.

Reproduced on qt6 at 2bd5a61e8304, macOS arm64 / Qt 6.9.0, isolated regtest, native window only. Limits:

  • I read the window's state through the test bridge and did not look at the screen. For a minimized window I do not know whether the Dock thumbnail is redrawn with the page.
  • Hide and minimize were calls through the test bridge, and the quit was the quit event (17 launches) or SIGTERM (5). I did not use the tray, the Dock, the menu, the yellow button or Cmd+Q.
  • Shutdown took under one second on regtest (0.09 to 0.91 s in the log). I did not measure it on a real node.
  • By the source, clicking the Dock or tray icon during shutdown brings the window back with the page. I did not run that.
  • Windows and Linux were not run.
When the app is asked to quit while its main window is hidden or minimized, its only shutdown notice, the page "Saving... / Do not shut down the computer until this is done.", is pushed into that window, and the window stays hidden or minimized until the process exits. The shutdown itself is normal. To reproduce: 1. Open a wallet and wait until the app is idle. 2. Hide or minimize the main window. I used the window's own `hide()` and `showMinimized()`, the calls that the tray's Hide and Window → Minimize make. 3. Send the application quit event, or SIGTERM, without showing the window again. The window's state by Qt, sampled from the quit until the process was gone: | Window at the quit | State until exit | Samples | |---|---|---| | Hidden | Hidden; the shutdown page was its current page in 30 of the samples | 33 of 33, 8 launches | | Minimized | Minimized; the shutdown page was its current page in all of them | 39 of 39, 7 launches | | On screen (control) | Windowed, showing the shutdown page | 16 of 17, 7 launches | The other 3 hidden samples and the one other control sample were taken before the app had noticed a SIGTERM; the last sample of every hidden launch had the shutdown page. All 22 launches exited 0 with `Shutdown done`. Four launches at `eed1f426fcb6` gave the same states. The shutdown handler clears the page stack and pushes the page. It does not show or raise the window: https://github.com/bitcoin-core/gui-qml/blob/2bd5a61e8304d5143e32f1ce977a2de2aceb6413/qml/pages/MainWindow.qml#L310-L314 By the source nothing else announces a shutdown: there is no second window, the tray tooltip and menu do not change, and there is no Dock badge or notification. Bitcoin-Qt, by its source, hides every window and opens a separate shutdown window in the same step, whatever state the main window was in ([bitcoin.cpp#L329-L341](https://github.com/bitcoin/bitcoin/blob/44901d8f64cb617714707bd025ecd83f108353c2/src/qt/bitcoin.cpp#L329-L341)). Suggested: show and raise the window in that handler, or use a separate small window as Bitcoin-Qt does. This is the same handler as in #1116. This is a missing notice, not a failure. A user who quits from the tray or the Dock with the window out of sight gets no word from the app that the node is still saving. Reproduced on `qt6` at `2bd5a61e8304`, macOS arm64 / Qt 6.9.0, isolated regtest, native window only. Limits: - I read the window's state through the test bridge and did not look at the screen. For a minimized window I do not know whether the Dock thumbnail is redrawn with the page. - Hide and minimize were calls through the test bridge, and the quit was the quit event (17 launches) or SIGTERM (5). I did not use the tray, the Dock, the menu, the yellow button or Cmd+Q. - Shutdown took under one second on regtest (0.09 to 0.91 s in the log). I did not measure it on a real node. - By the source, clicking the Dock or tray icon during shutdown brings the window back with the page. I did not run that. - Windows and Linux were not run.
Sign in to join this conversation.
No description provided.