Repository navigation
Stage an owned queue as a macOS or Linux session ends - #971
Merged
Merged
Conversation
An owning viewer's queue lives in its memory and is staged on the way out, which a Linux logoff never reaches. The X server goes first, and Xlib then ends the process with exit(1); systemd sends SIGTERM and SIGHUP, on which .NET ends it with no finally run. The snapshots went with it. ViewerProgram.SessionEnding stages the queue once and touches no window, and is heard both ways through PlatformHeads 0.6.0: deview_on_display_lost (ph::OnDisplayLost), which NativeViewerWindow takes as ILoopHooks.SessionEnding, and SessionEndSignals, held by ViewerProgram. The Windows hook still saves the placement after it. DEVIEW_VERSION is 13 for the new entry point, which the macOS shim exports and never calls: a logout's quit there is the app's own.
Co-authored-by: SimonCropp <122666+SimonCropp@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A viewer that owns the inline queue holds it in memory and stages it on the way out, but a Linux logoff never gets that far:
exit(1).finallyrun.Either way the snapshots were lost. Windows already staged them, through
HeadForm.SessionEnding.This moves to PlatformHeads 0.6.0 (SimonCropp/PlatformHeads#3), which hears both:
ViewerProgram.SessionEndingmarks the session closing and stages the queue. It runs once and touches no window, so it's safe on a signal's thread or inside a call into the window. A display lost during a mutation can't mark the session closing, but the queue is still staged.NativeViewerWindowimplementsILoopHooksand passesSessionEndingto the newdeview_on_display_lost. The Linux shim hands it toph::OnDisplayLost. The macOS shim exports it and never calls it, because a logout there is the app's own quit.ViewerProgramholds aSessionEndSignalsfor SIGTERM and SIGHUP. Signals don't save the placement, since they arrive on a thread of their own. The Windows hook still saves it after staging.DEVIEW_VERSIONgoes to 13 for the new entry point, and all six PlatformHeads pins move to 0.6.0.Checked in an
ubuntu:24.04container by building the shim at 0.6.0, then running the viewer under Xvfb, launched with an inline payload for a temporary project:obj/VerifyInline, then Xlib exited with code 1.ViewerProgramTestschecks thatSessionEndingstages the queue, does so from inside a mutation, and stages it only once.The committed binaries are still version 12, so the
nativejobs fail until the binaries PR thatbuild-nativeopens is merged into this branch.