Skip to content

Fix premature lock reblank on slow displays - #8773

Open
ClGratton wants to merge 1 commit into
omacom:quattrofrom
ClGratton:fix/lock-dpms-wake-grace
Open

ClGratton wants to merge 1 commit into
omacom:quattrofrom
ClGratton:fix/lock-dpms-wake-grace

Conversation

@ClGratton

@ClGratton ClGratton commented Aug 28, 2026 •

Copy link
Copy Markdown

Summary

  • keep the existing 5-second blank delay for a newly locked session
  • after waking an actually blanked display, preserve a 30-second grace window for slow DisplayPort panels to finish link training
  • keep later input from shortening that grace window
  • detect a system-resume wall-clock gap even when the ordinary blank timer had already fired, then apply the same complete wake grace

This addresses the wake-then-immediate-black symptom reported in #7399 without making every initial lock wait 30 seconds. Hyprland can report DPMS enabled before the physical panel is visibly ready, and QML timers resume before a slow panel finishes training, so either path can otherwise blank the output underneath monitor startup.

This is separate from #7806: that PR concerns wake-key leakage and keyboard auto-repeat into the password field.

Testing

  • test/shell.d/lock-wake-grace-test.sh
  • test/shell.d/lock-blank-fingerprint-test.sh
  • test/shell.d/lock-stranded-recovery-test.sh
  • test/shell.d/lock-password-overflow-test.sh
  • git diff --check

The complete test suite was also run for the original change. The focused wake-grace test was rerun after adding system-resume coverage; all eight assertions pass.

Addresses #7399.

Copilot AI balanced review requested due to automatic review settings August 28, 2026 16:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ClGratton
ClGratton force-pushed the fix/lock-dpms-wake-grace branch 2 times, most recently from c9f64fd to d2f5aaa Compare September 1, 2026 10:08
@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@ClGratton
ClGratton force-pushed the fix/lock-dpms-wake-grace branch from d2f5aaa to dcffddf Compare September 29, 2026 17:27
@ClGratton

Copy link
Copy Markdown
Author

Rebased onto current quattro (b421b1b). The PR's own displayBlanked flag stays separate from upstream's newer displaysBlank, because upstream clears displaysBlank on screen changes, which would cancel the wake grace. Upstream statements run first in runWake/runBlank, and lock-wake-grace-test.sh now matches displayBlanked = true anywhere in runBlank instead of requiring it on the first line. Note: this and #9632 both touch runWake, so whichever merges second will need a small rebase.

@omarchybot

Copy link
Copy Markdown
Collaborator

Looked at this at dcffddff, after the rebase onto quattro. Not reviewed yet: before the fix is reviewed, two models each classify the pull request, and today the second one, Codex Medium, could not run because its daily review budget was spent. Until both agree on what this is, nothing has been run on a worker and there is no verdict. My own read is a hardware-specific bug, slow DisplayPort panels per #7399, but one model's classification does not settle it.

So far I have only read the diff, #7399 and the neighbouring pull requests, without running anything. Two of them touch the same wake path. #9632 changes runWake in the same file, as you noted. #13259 changes omarchy-brightness-display's DPMS skip-guard, which the #7399 reporter also suspected.

Next: the classification is asked again on a later run, once the second reviewer is available, and the full review and a worker run follow from there. Nothing is needed from you in the meantime.

@ClGratton

Copy link
Copy Markdown
Author

Rebased onto current quattro (246f33a) as 4946c74; the one conflict was runWake/runBlank in lock/Service.qml, where upstream added fingerprint pause/resume.

  • Resolution: the wake grace stays first, then upstream's resumeFingerprint()/nudgeFingerprint(); runBlank keeps the grace bookkeeping and then calls pauseFingerprint().
  • One addition: upstream now re-arms the blank timer with the default 5 s from two new places (the fingerprint resume watch, and a panel coming back in onScreensChanged), which would have cut the 30 s grace short on exactly the slow-display wake this fixes. armBlankTimer() without a delay now uses max(5 s, remaining grace), with a test assertion for it. Behaviour with no active grace is unchanged.
  • Force DPMS enable on system wake when status is stale #13259 (DPMS skip-guard in omarchy-brightness-display) is still open and touches a different file, so there is no overlap. Keep idle lock handoff concealed #9632 changes runWake as well, so they conflict with each other in runWake when both are applied; each applies cleanly to quattro alone and whichever merges second needs a small rebase.
  • Tests: lock-wake-grace, idle, lock-*, apply-lock, system-lock, sleep-monitor, hyprland-session-lock*, qml-text-format and ./test/cli pass. Without a compositor, ./test/shell fails the same 22 files as plain quattro (unrelated), nothing new. I could not exercise a real slow DisplayPort panel.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] Adjusts lock screen blank timing for slow display hardware.

The PR appears safe to merge, with a non-blocking gap in its timing tests.

Findings

  1. P2 Broken wake timing passes tests ▶

Summary

The PR keeps the initial five-second blank delay and adds a 30-second grace window after a blanked display wakes.

  • A locked display waits 30 seconds after waking before blanking again.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[New lock] --> B[Arm five-second blank timer]
  B --> C[Blank display]
  C --> D[First wake]
  D --> E[Start 30-second grace]
  E --> F[Later activity preserves remaining grace]
  G[Resume gap detected] --> E
  F --> C
Loading

Reviews (1) · Last reviewed commit: "Fix premature lock reblank on slow displ..." · Reviewed by Greptile

Comment on lines +47 to +50
/id: systemResumeGapTimer[\s\S]*if \(elapsed > interval \+ 2000\) root\.handleSystemResume\(elapsed\)/.test(serviceQml),
'a wall-clock gap detects resume even after the ordinary blank timer stopped'
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Broken wake timing passes tests

lock-wake-grace-test.sh checks source text but never runs the wake or resume logic. Removing running: true from systemResumeGapTimer would disable resume detection after blanking, yet every assertion would still pass.

Add checks that run the changed functions with a controlled clock and timer. Cover the initial five-second delay, repeated input during grace, and resume after the blank timer has stopped.

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Oct 15, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 4946c74a, after the rebase onto quattro. Classified as a hardware-dependent bug (bug, compatibility): Claude Opus 5.5 and Codex Medium each decided this separately and agreed. Thanks for carrying it through two rebases.

Competing fix. #8561 (opened 2026-08-27, the day before this one) fixes the same thing, the 5-second re-blank that starts at the wake request rather than when the panel shows a picture, by raising idleBlankTimer to 30 seconds for every arm. When two fixes for one bug are similar, the older one is preferred unless the newer one shows it misses a case, breaks something, or does not fix the cause. I found none of those in #8561. The real difference is policy: this PR keeps the 5-second blank for a lock nobody has touched and holds 30 seconds only after a wake, while #8561 holds 30 seconds every time. That choice is the maintainer's, so I have not run this PR on a worker or labelled it verified. Codex Medium compared the two separately and also preferred #8561. Its answer may not be independent, because it can read this session's notes.

Read, not run. These were found by reading shell/plugins/lock/Service.qml at this head. If this PR is the one chosen, they matter:

  • A stale grace can carry into the next lock. When the compositor drops the lock on its own (onLockStateChanged, Service.qml:563), the handler clears lockRequested and calls runWake(). If the display was blank, runWake() starts a fresh 30-second wakeGraceUntil, and only finishUnlock() clears it. A lock taken within those 30 seconds then arms through beginLock() (:239) → armBlankTimer() → max(5 s, remaining grace), so it stays lit for up to 30 seconds instead of 5. Resetting both fields in beginLock() would close this.
  • The resume handling goes beyond Lock screen re-blanks ~1s after DPMS wake on slow-sync monitor, making unlock blind typing #7399. systemResumeGapTimer (:889) ticks every second for the life of the shell, unlocked too. On any wall-clock jump over 3 seconds while locked, handleSystemResume() runs omarchy-system-wake and holds the display lit for 30 seconds. That includes a lock whose display is already off and nobody is touching, and a jump caused by an NTP clock step or a stalled UI thread rather than a resume. Lock screen re-blanks ~1s after DPMS wake on slow-sync monitor, making unlock blind typing #7399 is fixed by the wake grace in runWake() alone. Without the resume part, this would be about a dozen lines.
  • The test checks the source text, not the behaviour. lock-wake-grace-test.sh matches regexes against the QML. For example, it still passes with idleBlankTimer.restart() removed from armBlankTimer().

Not reproducible here. A VM's display comes back from DPMS off instantly. On #7399, the reporter found that a 30-second interval did not fix their 6K panel, and another user found that 20 seconds did. So whichever fix lands, the reporter's machine may still have a second cause.

Next: this waits on the maintainer to choose between #8561 and this PR, which comes down to whether an untouched lock should still blank after 5 seconds. Nothing is needed from you in the meantime.

@markey

markey commented Oct 18, 2026

Copy link
Copy Markdown

Tested this locally on a Xiaomi Mi Monitor at 3440×1440@120 Hz over DisplayPort with an NVIDIA GTX 970. Previously, the monitor’s slow wake meant the lock screen sometimes blanked again before I could enter my password.

With this PR applied, waking and unlocking worked as expected, and the prompt stayed visible long enough to enter my password. I’ve since reverted the test checkout and returned to stock Omarchy.

This is an important usability fix that I’d strongly encourage merging as soon as possible. On slow-waking monitors, the current behavior can prevent users from reliably unlocking their sessions. Thanks for the fix!

@JonathanPitre

JonathanPitre commented Oct 21, 2026 •

Copy link
Copy Markdown

Retested locally on my Framework laptop with two external RTK FlipGo panels connected over USB-C carrying DisplayPort video, with this PR's patch applied.

After locking at 12:20:30, the displays went to sleep at 12:20:36. A key press woke the Framework's built-in panel first. The external panels came back one at a time while I was typing my password; the journal shows DP-2/DP-3 disconnecting and reconnecting, including a transient “Displays are still connecting” response. I unlocked at 12:20:59.

This confirms the slow external display wake behavior affects my setup. The lock session stayed available long enough to enter my password, though I unlocked about 14 seconds after the first wake, so I did not verify the full 30-second grace period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants