Repository navigation
core: defer unlock requests that arrive before the locked event - #1087
Open
martintrojer wants to merge 1 commit into
Open
martintrojer wants to merge 1 commit into
martintrojer wants to merge 1 commit into
Conversation
fadeOutAndUnlock() set m_fadeOutOrTerminate before returning early because the session was not locked yet. The PAM thread then exited and the correct password no longer unlocked; the request itself was dropped. Set the flag only once locked. Record the request and replay it from onLockLocked(). Ignore grace pointer motion until locked, like onKey already does, so it neither wedges PAM nor unlocks without a password after the grace period has run out.
martintrojer
marked this pull request as ready for review
October 28, 2026 10:34
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.
If an unlock request (SIGUSR1, fingerprint match, grace pointer motion) arrives before the compositor's
lockedevent,fadeOutAndUnlock()setsm_fadeOutOrTerminateand then returns because it isn't locked yet. The PAM thread sees the flag and exits, the request is dropped, and afterlockedthe correct password does nothing. Came in with 37f615c.Now the request is remembered (
m_unlockPending) and replayed fromonLockLocked(). Grace pointer motion also returns while not locked (likeonKeydoes), otherwise it would be replayed after grace had expired and unlock without a password.Tested on a real build with headless sway and a proxy that holds back only
locked: SIGUSR1 beforelockedis stuck on base, unlocks onlockedwith the patch.--grace 6, motion at t=0,lockedat ~13 s: no free unlock, password works. Motion afterlockedstill unlocks. Fingerprint not run, read from source only.#1065 changes
onLockLocked()too; itsstartFadeIn()should go before the replay.