Repository navigation
wayland/lock: emit lockStateChanged on unlock - #1289
Open
dmitrylito wants to merge 1 commit into
Open
dmitrylito wants to merge 1 commit into
dmitrylito wants to merge 1 commit into
Conversation
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>
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.
Describe your changes
WlSessionLock::unlock()never emittedlockStateChanged. When it checkedisLocked(), the lock was already cleared bymanager->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 aftermanager->unlock().I used the same
wasLockedpattern as the lock path.I save the state before unlocking, so that
lockStateChangedis emitted on unlock.AI disclosure
Claude helped find and test the fix; I reviewed and tested it on Hyprland 0.56.2.Open concerns
QML sets
locked = false, which runsunlock(). Then, insideunlock(), the manager releases the lock and sendsunlocked, which triggersunlock()again. Both runs sendlockStateChanged, 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 sendunlockedagain. 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.