Watch
1
0
Fork
You've already forked souveraine
0

lock: resync screenLocked when compositor ends our lock

ext-session-lock finished (another client held the lock) drops
WlSessionLock.locked C++-side; the request bool never heard about it.
Stale true lied to redaction/capability gates and blocked re-locking
(the binding only fires on a false->true edge).
This commit is contained in:
Fimeg 2026-07-17 06:17:53 -04:00
commit 4fe27d9ef5

View file

@ -121,6 +121,22 @@ Scope {
GlobalStates.screenLockSecure = secure;
console.log("[lock] session lock secure=" + secure);
}
// The compositor can end our lock without us asking: ext-session-lock
// `finished` (denied because another client held it) makes quickshell
// drop `locked` to false C++-side. Our request bool never hears about
// it, so it lingers true which lies to every gate reading it
// (redaction, capability tiers, session state IPC) and blocks
// re-locking, because the `locked:` binding only re-fires on a
// false->true edge of screenLocked. Resync on that path. A normal
// unlock clears screenLocked *before* the binding drops `locked`,
// so this guard stays quiet there.
onLockStateChanged: {
if (!lock.locked && GlobalStates.screenLocked) {
console.log("[lock] compositor ended our session lock while still requested — resyncing");
GlobalStates.screenLocked = false;
}
}
}
function lock() {