Skip to content

Keep the lock lit for a while after it is woken - #592

Merged
maralcbr merged 1 commit into
mac/87-wake-keyfrom
mac/92-lock-lit-after-wake
Sep 26, 2026
Merged

maralcbr merged 1 commit into
mac/87-wake-keyfrom
mac/92-lock-lit-after-wake

Conversation

@maralcbr

Copy link
Copy Markdown
Member

Stacked on #589 (base mac/87-wake-key); retarget to quattro-upstream once #589 merges.

Owner report on the M2: after a lid-open wake the unlock screen lit, then went dark again about 5 s later with no input. The log shows the resume watch waking the lock and re-arming the same 5 s run-up the lock takes when it is first locked. A second path had the same effect: when sleep-lock suspends within a second of locking, the resume watch had no tick to compare against and missed the resume, so the blank timer's own frozen-countdown branch re-armed 5 s.

Now a wake from a blank panel or from suspend keeps the lock lit for 30 s. Input re-arms the usual 5 s but never cuts a longer run-up short, so the panel goes dark 30 s after the wake or 5 s after the last input, whichever is later. The resume watch starts its clock when the lock is taken, and the frozen-countdown branch takes the 30 s run-up too. An untouched lock still blanks 5 s after locking. The wake-key swallow (#589) and focus recovery (#583) are unchanged. Generic, not Apple-specific.

Tests: new lock-lit-after-wake runs the service's own armBlankTimer/runWake against a fake clock (lock, wake from blank, early and late input, resume over a frozen countdown, unlocked) and pins the resume watch and frozen-countdown branches; it fails on the previous service. The lock-*, sleep-lock, system-lock, hyprland-session-locked, apply-lock and video-background suites pass on an x86 Omarchy host with a live Hyprland compositor.

Second review: no defects. Noted and left as is: a failed password gets the normal 5 s; when every panel comes back lit after a hotplug flap the lock stays lit until input (predates this change, and re-arming there would loop a flapping external monitor).

Owner check on the M2: lock (Super+Ctrl+L), close the lid, wait for sleep, open the lid and don't touch anything: the built-in panel stays lit at least 30 s, then goes dark. Open again, type the password: unlocks. Also: lock, let it go dark, press a key: stays lit ~30 s without further input.

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.
@maralcbr
maralcbr merged commit 7ecb4cf into mac/87-wake-key Sep 26, 2026
4 checks passed
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.

1 participant