Repository navigation
Conversation
lock-before-suspend released the logind sleep delay inhibitor as soon as Qt reported the lock rendered (afterAnimating/afterRendering). That signal fires before the compositor has committed/presented the ext-session-lock surface, so the machine could freeze ~1 frame later with the desktop still the last presented frame. On resume the desktop was briefly visible before the lock appeared (both suspend and hibernate). Gate lockerReady on WlSessionLock.secure (the ext-session-lock `locked` event), so the inhibitor is held until the compositor confirms the session is locked and the desktop is hidden. LockSurface passes the WlSessionLock down as sessionLock; the readiness check returns early until secure, and re-fires on secureChanged. The Go-side fallback timer in loginctl monitor remains as the backstop. Reproduced on niri / s2idle with 3 outputs: debug log showed lockerReady sent 18 ms before `PM: suspend entry`; with this change the desktop no longer flashes on resume. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Thomas Kroll <[email protected]>
bbedward
pushed a commit
that referenced
this pull request
Jul 24, 2026
lock-before-suspend released the logind sleep delay inhibitor as soon as Qt reported the lock rendered (afterAnimating/afterRendering). That signal fires before the compositor has committed/presented the ext-session-lock surface, so the machine could freeze ~1 frame later with the desktop still the last presented frame. On resume the desktop was briefly visible before the lock appeared (both suspend and hibernate). Gate lockerReady on WlSessionLock.secure (the ext-session-lock `locked` event), so the inhibitor is held until the compositor confirms the session is locked and the desktop is hidden. LockSurface passes the WlSessionLock down as sessionLock; the readiness check returns early until secure, and re-fires on secureChanged. The Go-side fallback timer in loginctl monitor remains as the backstop. Reproduced on niri / s2idle with 3 outputs: debug log showed lockerReady sent 18 ms before `PM: suspend entry`; with this change the desktop no longer flashes on resume. Signed-off-by: Thomas Kroll <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]> (cherry picked from commit 237fb57)
marcusramberg
pushed a commit
to marcusramberg/DankMaterialShell
that referenced
this pull request
Sep 2, 2026
…bs-dev#2907) lock-before-suspend released the logind sleep delay inhibitor as soon as Qt reported the lock rendered (afterAnimating/afterRendering). That signal fires before the compositor has committed/presented the ext-session-lock surface, so the machine could freeze ~1 frame later with the desktop still the last presented frame. On resume the desktop was briefly visible before the lock appeared (both suspend and hibernate). Gate lockerReady on WlSessionLock.secure (the ext-session-lock `locked` event), so the inhibitor is held until the compositor confirms the session is locked and the desktop is hidden. LockSurface passes the WlSessionLock down as sessionLock; the readiness check returns early until secure, and re-fires on secureChanged. The Go-side fallback timer in loginctl monitor remains as the backstop. Reproduced on niri / s2idle with 3 outputs: debug log showed lockerReady sent 18 ms before `PM: suspend entry`; with this change the desktop no longer flashes on resume. Signed-off-by: Thomas Kroll <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
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.
Fixes #2906.
Problem
lock before suspendreleases the logind sleep delay inhibitor as soon as Qt reports the lock rendered (onAfterAnimating/onAfterRenderinginLockScreenContent.qml). Those signals fire when Qt finishes its render pass — before the compositor has committed/presented theext-session-locksurface. The machine then freezes ~1 frame later with the desktop still the last presented frame, and on resume the desktop is briefly visible before the lock appears (suspend and hibernate alike).Measured on niri / s2idle (3 outputs):
lockerReadywas sent 18 ms beforePM: suspend entry. The handshake and fallback logic incore/internal/server/loginctl/monitor.goare correct — only the readiness signal was too early.Change
Gate
lockerReadyonWlSessionLock.secure— theext-session-locklockedevent, i.e. the compositor's own confirmation that the session is locked and the desktop is hidden:LockSurface.qmlpasses theWlSessionLockdown to the content assessionLock.LockScreenContent.qmlmaybeSend()returns early whilesessionLock && !sessionLock.secure, and aConnections { onSecureChanged }re-fires the check when the compositor confirms the lock.The Go-side 2–4 s fallback timer is unchanged as the backstop. When no lock object is present (e.g. demo mode) behavior is unchanged.
Testing
Built as an external shell dir (
dms run -c) on the reporter's machine (niri, s2idle, 3 outputs), same build otherwise:lockerReadysent 18 ms beforePM: suspend entry.Note
With multiple outputs, the Go side releases the inhibitor on the first of the N per-output
lockerReadycalls (handlers.gohandleLockerReady). Not the cause here (all outputs reported within the same ms), but flagging it as a possible secondary race for a follow-up.