Repository navigation
Move to PlatformHeads 0.13.0 and let a macOS logout through - #1029
Merged
Merged
Conversation
The seven pins move together to 0.13.0, whose TerminateGuard takes a sessionEnding to run at a logout, restart or shutdown before letting the quit through. Refused, as every quit was, it cancelled the logout. The viewer hands TerminateGuard what the managed side already gave deview_on_display_lost on every platform, which stages the queue it owns and saves the placement, so the ABI does not move. The tray gains detray_on_session_end, which MacTray sets before detray_init to TraySessionEnd.For, the same session end the signals run, and DETRAY_VERSION goes to 2.
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.
PlatformHeads 0.13.0 (PlatformHeads#14) lets
TerminateGuardtake asessionEnding. At a logout, restart or shutdown it runs that from inside the pump and lets the quit through.Until now both macOS heads refused every quit that came from outside the managed loop. A refused quit cancels the logout that asked for it, so with the tray or a viewer running, the person had to log out again once it had gone, and an unattended restart didn't happen.
Pins. All seven move to 0.13.0 together, and
claude.mdsays so.Viewer. No ABI change.
deview_on_display_lostits session end on every native window. That runsViewerProgram.SessionEnding, which stages the queue the viewer owns, and then saves the placement.Runtimekeeps the callback and gives it toTerminateGuardassessionEnding.DEVIEW_VERSIONbump. Either side paired with the other side at a different age behaves as it did before, so nothing can be misread.deview.hrecords this.deview_init, so no event that could be a logout is dispatched without it.Tray.
DETRAY_VERSIONgoes to 2.detray_on_session_end, takes the callback.MacTray.Opensets it beforedetray_init, becauseTray.startnow makes the guard from whatever was set by then. A library with no callback refuses a session's end as before, which cancels the logout but loses nothing.[UnmanagedCallersOnly]function pointer, as the viewer's is. That's whyDiffEngineTray.Corenow allows unsafe code.ProgrambuildsTraySessionEnd.For(owned, TrayVersionFile.Delete)once. It hands it to bothMacTray.SessionEndingandSessionEndSignals, so the queue is staged and the version marker removed whichever way the session ends.detray_quittingnow reports only quits other than a session's end, such as AppleScript'squit.detray.h's pointer to the managed half now namessrc/DiffEngineTray.Core/Detray.cs, where it moved to.Binaries. The Swift changed, so
build-nativeshould propose rebuilt macOS libraries into this branch. Until those land, thenativejob will report the tray library as version 1 where version 2 is expected. That's the version check doing its job.Tests. Locally on Windows, the Release build had no errors. Of 3,845 tests in the whole solution, 3,792 passed, 49 were skipped and 4 failed. The four are the ListenerTable tests that always fail on this machine's Windows build (10.0.26300), two each on net48 and net10.0, and they don't touch anything this PR changes.
Nothing here could be compiled or run on macOS locally. CI's
unixjob builds both libraries from source, andMacTrayTestschecks the tray library reports version 2.Nothing has been tried with a real logout. PlatformHeads'
TerminateGuardTestscover the guard's answer to each kind of quit. What CI can't do is log a Mac out. Worth trying by hand on a Mac before a release: log out with the tray holding an inline snapshot, and check that the logout goes through and the trio is staged inobj/VerifyInline.