fix(lock): deferred lock when no monitor is connected blocks suspend#2998
Open
mattvilim wants to merge 1 commit into
Open
fix(lock): deferred lock when no monitor is connected blocks suspend#2998mattvilim wants to merge 1 commit into
mattvilim wants to merge 1 commit into
Conversation
…until monitor reconnects
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.
Summary
When a suspend with
lock_before_suspend=truebehavior is triggered but no monitor is connected, the computer never suspends.Steps to reproduce:
Motivation
Commit 7e013e8 fixed an issue where idle lock behavior triggered when no monitor is connected would cause a lock screen crash (Niri red screen). The fix deferred lock until a monitor reconnects. As as a side effect, the suspend is also deferred, so unplugging a monitor will cause the computer never to suspend. On reconnecting the monitor, the computer immediately suspends.
As a side note,
[idle.behavior.suspend].lock_before_suspendisn't documented. Not sure if there's a reason to keep it if the user can just setcommand = "noctalia:session lock-and-suspend"as the suspend command? This fix applies to both cases.Type of Change
Related Issue
N/A
Testing
I tested the following cases both with/without unplugging monitor before idle triggers, and it fixes both.
lock-and-suspendwithlock_before_suspend = falsesuspendwithlock_before_suspend = trueManual Coverage
Screenshots / Videos
N/A
Checklist
CONTRIBUTING.md.just formatwith clang-format v22+ installed, or this PR has no code changes.assets/translations/en.json, or this PR adds no new user-facing strings.Additional Notes