Repository navigation
Keep the lock lit after a wake, including one it never saw - #605
Merged
Merged
Conversation
After a lid-open wake the unlock screen lit and went dark again five seconds later with no input, the same run-up the lock takes when it is first locked. The user has just opened the lid to look at it. A wake from a blank panel or from suspend now keeps the lock lit for 30 seconds. Input re-arms the usual five seconds but never cuts a longer run-up short, so the panel goes dark 30 seconds after the wake or five seconds after the last input, whichever is later. The resume watch starts its clock with the lock, so a suspend within a second of locking (sleep-lock) is still seen.
The power button is a locked Hyprland bind, so pressing it at a blank lock lights the panels without any key reaching the lock. The lock kept thinking it was blank and never armed a run-up for that wake. While the lock is blank it now polls Hyprland's DPMS state, as it already did for a video wallpaper. Every enabled panel lit means something woke them, so the lock wakes with the 30 second run-up. Answers asked for before a blank or wake finished are dropped, and a panel coming back mid-blank is left to the screen-change settle.
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.
Owner check on the M2 (image 4 plus quattro-upstream's lock files): lock, wait for dark, wake with a key or the power button, and the screen went dark again about 5 s later.
Two causes:
mac/87-wake-keyafter Keep the key that wakes a blanked lock out of the password #589 had already landed, so it never reachedquattro-upstream. The first commit here is that change, cherry-picked unchanged.XF86PowerOff→ system menu). Hyprland lights the panels, but no key reaches the lock, so the lock still thought it was blank and never armed a run-up. While blank, the lock now polls Hyprland's DPMS state every 5 s, as it already did for a video wallpaper. Every enabled panel lit counts as a wake and gets the same 30 s run-up as a key. Answers asked for before a blank or wake finished are dropped, so a poll can't undo either one. A panel coming back mid-blank is still left to Keep the key that wakes a blanked lock out of the password #589's screen-change settle, so a USB-C monitor that reconnects lit after a blank (on kernels without the DPMS fix) isn't treated as a wake.A key at a blank panel is still swallowed (#589), focus recovery (#583) is unchanged, and an untouched lock still blanks 5 s after locking. Generic, not Apple-specific.
Tests:
lock-lit-after-wakeruns the service's ownarmBlankTimer,runWakeandtakeMonitorDpmsagainst a fake clock. It covers a wake from blank, early and late input, resume over a frozen countdown, a power-button wake the lock never saw, and answers that are stale or race a blank, a wake or a screen change. It also covers one panel still dark, no panels, and a lit video lock. Thelock-*,sleep-lock,system-lock,hyprland-session-locked,apply-lockandvideo-backgroundsuites pass on an x86 Omarchy host with a live Hyprland compositor.Second review: no blocking defects. Taken: drop answers that race a wake; poll a still wallpaper every 5 s rather than 3 s. Noted: a poll answered between Hyprland lighting the panel and the wake key reaching the lock could let that one key through (a timing window of a few ms every 5 s).
Owner check on the M2: lock with Super+Ctrl+L and wait for dark. Press a letter: lit for about 30 s with no further input, then dark. Let it go dark again, press the power button (close the power menu if it appears after unlock): lit for about 30 s, then dark. Type the password: unlocks.