Skip to content

Keep the lock lit after a wake, including one it never saw - #605

Merged
maralcbr merged 3 commits into
quattro-upstreamfrom
mac/92-grace-image4
Sep 27, 2026
Merged

maralcbr merged 3 commits into
quattro-upstreamfrom
mac/92-grace-image4

Conversation

@maralcbr

Copy link
Copy Markdown
Member

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:

  • Keep the lock lit for a while after it is woken #592 (30 s lit after a wake from blank or resume) was merged into its stacked base mac/87-wake-key after Keep the key that wakes a blanked lock out of the password #589 had already landed, so it never reached quattro-upstream. The first commit here is that change, cherry-picked unchanged.
  • The power button is a locked Hyprland bind (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-wake runs the service's own armBlankTimer, runWake and takeMonitorDpms against 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. 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 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.

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.
@maralcbr
maralcbr merged commit 8d63810 into quattro-upstream Sep 27, 2026
5 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