Skip to content

wayland/lock: emit lockStateChanged on unlock - #1289

Open
dmitrylito wants to merge 1 commit into
quickshell-mirror:masterfrom
dmitrylito:fix/session-lock-unlock-signal
Open

dmitrylito wants to merge 1 commit into
quickshell-mirror:masterfrom
dmitrylito:fix/session-lock-unlock-signal

Conversation

@dmitrylito

Copy link
Copy Markdown

Describe your changes

WlSessionLock::unlock() never emitted lockStateChanged. When it checked isLocked(), the lock was already cleared by manager->unlock() and was always false. In Omarchy this means the lock keybind does nothing after the first unlock.

Fixes #1230

Details and descisions

This is a regression from afb2c27, which moved the isLocked() check after manager->unlock().
I used the same wasLocked pattern as the lock path.
I save the state before unlocking, so that lockStateChanged is emitted on unlock.

AI disclosureClaude helped find and test the fix; I reviewed and tested it on Hyprland 0.56.2.

Open concerns

QML sets locked = false, which runs unlock(). Then, inside unlock(), the manager releases the lock and sends unlocked, which triggers unlock() again. Both runs send lockStateChanged, so it fires twice per unlock. It doesn't loop, because on the second run the lock is already released, so the manager doesn't send unlocked again. Same as 0.3.1, so I left it as is.

Participation

I'm new to C++, but I understand this change and can explain it. Happy to follow up on review and learn more.
I used AI to help find and test the fix; I reviewed it and tested it on Hyprland 0.56.2.

unlock() checked isLocked() after manager->unlock() had already cleared
the lock, so lockStateChanged was never emitted when a lock ended and
bindings on WlSessionLock.locked stayed true.

Fixes quickshell-mirror#1230

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WlSessionLock: lockStateChanged is never emitted on unlock (bindings on locked stay stale)

1 participant