Always quit after the final sync ends #5

Merged
salix merged 2 commits from t3code/fix-window-close-quit into main 2026-10-03 17:46:07 +02:00
Owner

Closing the Adwaita window with pending changes (or with a sync in flight) hides the window and leaves quitting entirely to the final syncs completion handler: it destroys the window only when the last upload settles.

That handler can miss its destroy in several ways, and each left the process running invisibly with no windows:

  • the chained restart of the final sync fails to start (for example when the sync settings disappear between close and the restart) and nothing ever finishes the closing flow
  • the completion handler unwinds before reaching the destroy
  • the remote space switch returns its rebuilt window before checking closing

On top of that the closing wait had no deadline: a slow final upload can keep the process alive for minutes after the window is gone, which reads as the app not quitting.

This change arms a watchdog the moment closing starts. It destroys the hidden window as soon as nothing is in flight that releasepath, and no later than two minutes after the close. When the deadline fires mid-upload the application quits explicitly, since the running sync still holds it: the upload stays pending and is picked up on the next launch.

Verified against a virtual X11 display with a real close event:

  • a profile without sync configured closes and quits immediately
  • a profile with a configured sync target fails the final attempt and quits
  • GTK-level probes confirm that a close that stops, hides, holds, and later destroys the window ends the app, and that a deadline destroy plus explicit quit ends the app even with a hold outstanding
Closing the Adwaita window with pending changes (or with a sync in flight) hides the window and leaves quitting entirely to the final syncs completion handler: it destroys the window only when the last upload settles. That handler can miss its destroy in several ways, and each left the process running invisibly with no windows: - the chained restart of the final sync fails to start (for example when the sync settings disappear between close and the restart) and nothing ever finishes the closing flow - the completion handler unwinds before reaching the destroy - the remote space switch returns its rebuilt window before checking closing On top of that the closing wait had no deadline: a slow final upload can keep the process alive for minutes after the window is gone, which reads as the app not quitting. This change arms a watchdog the moment closing starts. It destroys the hidden window as soon as nothing is in flight that releasepath, and no later than two minutes after the close. When the deadline fires mid-upload the application quits explicitly, since the running sync still holds it: the upload stays pending and is picked up on the next launch. Verified against a virtual X11 display with a real close event: - a profile without sync configured closes and quits immediately - a profile with a configured sync target fails the final attempt and quits - GTK-level probes confirm that a close that stops, hides, holds, and later destroys the window ends the app, and that a deadline destroy plus explicit quit ends the app even with a hold outstanding
Closing the Adwaita window with pending changes hid the window and left
quitting entirely to the final sync's completion handler. When that
handler never reached its destroy — a chained restart that could not
start, a worker unwinding mid-handler, or the remote space switch that
returns before the closing check — the process stayed alive invisibly.
Now close arms a watchdog that destroys the hidden window as soon as
nothing is in flight, and no later than two minutes after the close, so
the application always quits.
salix merged commit 812f1387aa into main 2026-10-03 17:46:07 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
salix/threado!5
No description provided.