Repository navigation
Conversation
Moving the mouse or pressing a key on a locked, blanked display wakes the panel, but panels take seconds to light up after DPMS off. Waking armed the standard 5-second idle interval immediately at input time, reblanking before users could finish typing their password. Grant a 15-second grace on the first wake after blanking, and preserve that deadline across bursts of subsequent wake events so mouse movements cannot shorten the grace back to five seconds before the user can type. Fixes omacom#17453.
[Medium impact] The PR appears safe to merge, with one non-blocking test improvement. Findings
SummaryGives the first wake after a blank a 15-second countdown and preserves longer running countdowns across further wake input.
Reviews (3) · Last reviewed commit: "Never let an idle arm shorten a pending ..." · Reviewed by Greptile |
The burst check accepted any deadline at or past the first wake's, so restarting the full 15s grace on every burst wake would pass. Shift the armed grace back 7s before the burst so a re-granted deadline lands strictly later, and require armedAt + interval to equal the first wake's deadline.
|
Root cause and a 3-line fix, measured on a MacBookPro11,5 (Omarchy 4.5.0-3, no fingerprint reader, session locked and blanked before suspend): The 15 s resume grace is armed: Making function armBlankTimer(delayMs) {
var want = delayMs || idleBlankTimer.idleMs
if (idleBlankTimer.running && idleBlankTimer.armedAt + idleBlankTimer.interval - Date.now() > want) return
idleBlankTimer.interval = want
idleBlankTimer.armedAt = Date.now()
idleBlankTimer.restart()
}Same machine with this patch (dpmsStatus polled every 200 ms across an RTC-woken S3 cycle): Input still behaves as before: once the grace has less than 5 s left, a keypress re-arms the normal 5 s. The display is never blanked earlier than today. Only the blank timing changes; locking itself is untouched. How this was produced: this comment was written by Claude Opus 5.5 (Anthropic's AI model), working as an autonomous agent on my behalf, and is posted with my approval. Method: hardware-in-the-loop testing on my own MacBookPro11,5. An Ubuntu mini-PC drove the Mac over SSH (Tailscale) and through a JetKVM (HDMI capture + USB HID keyboard for login and remote wake). A scripted S3 harness armed an RTC alarm (or sent a USB HID wake), suspended with |
Guard armBlankTimer so a shorter delay does not cut short a longer pending countdown, replacing the graceDeadline mechanism. This fixes the resume-grace overwrite from PR review (teuteuguy's timeline: resume arm 15s -> screensChanged or runWake no-arg re-arm 5s). Update the lock fingerprint service test fixture to cover resume grace preservation across output re-detection and wake bursts, as well as the stopped-timer re-arm semantics.
|
Pushed d584b10 addressing this — thanks for the hardware-tested timeline, it made the failure mode unambiguous.
Your other invariant is pinned by fixture assertions: the display never blanks earlier than before, and input once the grace is mostly spent re-arms the 5 s run-up. One deliberate divergence from your patch snippet, noted in the review: with the timer stopped during a password check, a no-arg arm re-arms 5 s rather than restoring an older deadline — the user is interacting by definition at that point, which is the grace doing its job. The |
| blankTimer.stop() | ||
| service.runWake() | ||
| check(blankTimer.interval === 5000, "input ending a password check arms the normal 5s run-up even with grace left over") |
There was a problem hiding this comment.
Password-check case misses remaining grace
The preceding check has already changed blankTimer.interval to 5000. Stopping that timer and calling runWake() does not test the claimed case “even with grace left over.” A regression that restores the remaining 15-second grace after a password check would still pass.
Arm a fresh 15-second grace before stopping the timer, then check that ending the password check starts the normal 5-second countdown.
|
This looks like the fix to land for the early re-blank. It keeps fixed timings, no setting (DHH ruled a setting out on #6642), and it also stops a plain re-arm from cutting the 15 s resume grace from #17277 back to 5 s. Same problem as #7399, #7749, #15759, #17042, #17228 and #18926, plus #11411 and #14905 after resume. The |
|
GPT-6 High in Codex read the diff, discussion, linked issue #17453 and base-branch rules. I classified this as a bug fix, but the classification model, deepseek-v4p1-flash, returned no class, leaving classification unsettled. No full code review or worker tests ran, and no labels were added; this is waiting on a classification decision before verification. |
Fixes #17453
Problem
On a locked display that has been DPMS-blanked, the first wake input (mouse move or key press) re-armed the 5-second idle blank timer immediately at input time. Panels take seconds to actually light up after DPMS off, so the countdown could expire and reblank the screen before the user managed to type anything — sometimes requiring repeated input for ~10 seconds before the password could be entered.
Fix
idleBlankTimer.wakeMs) instead of the 5-second idle interval, so there is time to see the unlock screen and start typing.resumeMs) survives the output re-detection and wake input that fire within a second of a real resume — previously a no-arg re-arm overwrote it with the 5-second idle run-up, blanking the panel ~5 s after resume (review timeline).beginLock()andfinishUnlock()reset the grace state so no lock cycle inherits a stale one; a password check in flight still holds the display up and re-arms the 5-second run-up when it ends.Test
test/shell.d/fixtures/lock-fingerprint-service/shell.qmlgains four wake assertions: grace on the first wake after a blank, a burst of wake input keeps the deadline, a wake after the grace was consumed returns to the 5-second interval, and a fresh grace after the next blank. The fixture needs quickshell + a compositor, so the test skips on headless boxes.bash -nandshellcheckclean on the touched test script; the JS of the touched QML functions parses withnode --check.Follow-up (greptile P2)
097f97d05tightens the fixture so a burst of wake input must keep the exact 15s grace deadline (not merely>=). The later wake is modeled 7s after the first so a re-granting regression fails the equality check.