Skip to content

Stop a wedged blank or wake child from silently disabling the lock screen's display control - #7673

Open
omarchybot wants to merge 11 commits into
quattrofrom
fix/issue-7652
Open

omarchybot wants to merge 11 commits into
quattrofrom
fix/issue-7652

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

After locking, the display never powers off, and once it starts the shell never blanks again until omarchy restart shell.

runBlank() and runWake() each drove a single Process object created once and reused for the life of the shell. Quickshell's Process is running while its QProcess exists and clears only on QProcess::finished, so one child that never exits pins the object true forever — startProcessIfReady() returns while a process exists, and the if (!process.running) guard in front of it drops the request outright rather than deferring it to an exit that never arrives. Every blank and every wake after that is discarded with no timeout, no reset, no log line, and nothing in the service's IPC status() to see it by.

The blank half leaves the panel lit behind the lock surface. The wake half is worse and was latent in the same code: runWake() is what unlock, a failed password, a lost session lock, and every key and pointer event call to bring the display back, so a wedged wake leaves a black screen that does not answer input.

Both spawns are now stateless, which removes the state that could latch. runWake() still coalesces, because LockView's full-surface MouseArea sets hoverEnabled and calls it from onPositionChanged — so without a replacement, moving the mouse on the lock screen would fork a bash plus two hyprctl round trips per motion event. It coalesces on a Timer rather than on wall-clock arithmetic a backwards clock step could suppress, and unlock and a lost session lock bypass the window entirely, since the surface is gone by then and no later input can ask again. runBlank() logs blank-requested, so the next blank that goes missing says so in the journal and in lastEvent.

What made one child stop exiting after roughly a day is not established, and this does not claim to fix it — it makes it survivable. The likeliest candidate is an unbounded hyprctl call: omarchy-brightness-display resolves the focused monitor through hyprctl monitors -j | jq before it reaches the off branch that never uses the answer, and neither that call nor the DPMS dispatch after it has a timeout. Hoisting that query below the off/on branches would remove one such call from every blank and every wake, and is worth doing separately.

Note for sequencing: #7179 rewrites both runWake() and runBlank() for fingerprint thermal backoff and will conflict textually, and #6538 and #6642 both edit blankProcess's command line, which is gone here. None of them change the spawn semantics, so all three resolve by reapplying their own change to the new bodies.

Fixes #7652

Quickshell's Process is `running` while its QProcess exists and clears only on `QProcess::finished`, so a child that never exits pins the object true and nothing later can start: `startProcessIfReady()` returns while one exists, and the `if (!process.running)` guard in front of it drops the request outright instead of deferring it to the exit that never comes. `runBlank()` and `runWake()` each drove one such object for the life of the shell, which turns a single wedged blank child into a lock screen that never blanks again, and a single wedged wake child into a display that never comes back on input -- with no timeout, no log line, and nothing in the service's IPC status to see it by.

`runWake()` keeps coalescing, because `LockView`'s full-surface `MouseArea` sets `hoverEnabled` and calls it from `onPositionChanged`, but it coalesces on a Timer rather than on a process it can no longer observe, and rather than on wall-clock arithmetic a backwards step would suppress. Unlock and a lost session lock wake unconditionally, since the surface is gone by then and no later input can ask again. `runBlank()` logs, so the next blank that goes missing says so in the journal and in `lastEvent`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Codex XHigh <noreply@openai.com>

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.

Pull request overview

Reworks lock-screen blank/wake execution to prevent wedged reusable processes from disabling display control.

Changes:

  • Uses detached blank and wake processes.
  • Coalesces wake requests and forces wake on unlock.
  • Adds blank logging and regression tests.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
shell/plugins/lock/Service.qml Implements stateless display control and wake coalescing.
test/shell.d/lock-blank-spawn-test.sh Adds regression assertions for spawn behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread shell/plugins/lock/Service.qml Outdated
// ask again for a wake the coalescing window swallowed.
function forceWake() {
wakeCoalesceTimer.restart()
Quickshell.execDetached(["bash", "-c", "omarchy-system-wake"])
Comment thread test/shell.d/lock-blank-spawn-test.sh Outdated
)

assert(
/function forceWake\(\) \{[\s\S]*?Quickshell\.execDetached\(\["bash", "-c", "omarchy-system-wake"\]\)/.test(serviceQml),
omarchybot and others added 3 commits September 28, 2026 13:23
quattro gave runWake() and runBlank() the lock's displaysBlank and monitorDpmsKnown bookkeeping for video wallpapers. That state is cheap and must follow every request, coalesced or not, so it stays at the top of runWake(), which now owns the coalesced spawn; forceWake() just clears the window and calls it. That keeps video-background-test's shape for runWake() and runBlank(), and bounds this branch's assertions to one function body each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reused Process serialized its children, which is what let one hung child latch every later request. Detached children are not serialized at all, so the same hang now costs a new stuck process tree every coalescing window for as long as the pointer moves. Ten seconds is far past any healthy blank or wake, and timeout kills the child's whole process group, hyprctl included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lazy [\s\S]*? runs past the closing brace, so moving the lost-lock forceWake() into onScreensChanged still satisfied the assertion. Neither body has nested braces, so [^}]* holds each match to the function it names.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Sep 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Brought this up to date with quattro and verified it on an Omarchy worker VM. Three commits were pushed to the branch.

What changed on the branch

  • c373c4a5 merges quattro. Since this was opened, quattro gave runWake() and runBlank() the displaysBlank / monitorDpmsKnown bookkeeping for video wallpapers. That state now stays at the top of runWake() and follows every request, coalesced or not. runWake() owns the coalesced spawn, and forceWake() clears the window and calls it. That keeps the shape video-background-test.sh asserts.
  • 93f1d3ea wraps both detached spawns in timeout 10. This answers Copilot's first review comment, which holds: a reused Process serialized its children, but detached ones are not serialized at all, so a child that hangs the same way would be joined by another every coalescing window for as long as the pointer moves. timeout signals the child's whole process group, so a stuck hyprctl goes with it.
  • 295a1134 bounds the finishUnlock() and lost-lock assertions in test/shell.d/lock-blank-spawn-test.sh to their own bodies. Copilot's second comment asked for this for the wake-spawn assertion, which the merge already bounded. The second opinion then found the two assertions it had missed: moving the lost-lock forceWake() into onScreensChanged still passed.

Verified on a worker (shell linked to each tree, quickshell -p confirmed against it). omarchy-brightness-keyboard was made to hang once on off, then the session was locked, and each blank was triggered by an Escape keypress on the lock surface:

  • quattro at de63134b: the display stayed lit after the first blank, as intended, and then stayed lit through two more blanks and an unlock. The hung child was still running at the end. This is Display never blanks after lock: blank/wake silently stops working in a long-running shell #7652.
  • This branch: the second and third blanks turned DPMS off, each wake turned it back on, unlock worked, and the hung child was gone once the timeout passed.
  • lock-blank-spawn-test.sh passes 7/7 here and fails on quattro. lock-blank-fingerprint, lock-stranded-recovery, lock-wallpaper-preload, lock-fingerprint-indicator, lock-password-overflow, owe-lock and system-lock pass.

Not green, and not from this change. ./test/cli fails vscode generated theme references current theme file, and video-background-test.sh passes all 32 assertions but exits 1 on an unbound PREPARED_BACKGROUND_SNAPSHOT. Both fail identically on quattro at de63134b. CI (CodeQL) passed on the previous head.

Second opinion: Codex Medium reviewed two rounds against this head. The first round found the unbounded assertions above. The second found nothing open, and agreed that wakes can't be swallowed while locked (every runWake() re-arms the 5 s blank timer, and unlock and a lost lock bypass the window). Independence is not guaranteed, since it could read this session's reasoning. It also noted that timeout sends SIGTERM, not SIGKILL. That is enough for hyprctl and sleep, but it is not an unconditional bound.

No competing fix is open. #7179 and #6642 still touch the lock's blank and wake and will conflict textually. Neither changes how the spawns work.

Waiting on the maintainer: the branch is verified, and it stays short of ready only because of the two quattro test failures above.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 14, 2026
omarchybot and others added 2 commits October 14, 2026 10:35
quattro taught the lock to pause the fingerprint reader while the displays are off, so runBlank() calls pauseFingerprint() and runWake() calls resumeFingerprint() and nudgeFingerprint(). Those follow every request, coalesced or not, so they stay outside the coalescing window. The coalesced spawn moves to the end of runWake(): lock-blank-fingerprint-test matches the function body with [^}]*, and the spawn's own block closing ahead of resumeFingerprint() would end that match early.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
timeout's SIGTERM reaches the child's whole process group, but bash dies on it, timeout then exits, and any --kill-after never fires: a grandchild that ignores SIGTERM, a wedged hyprctl say, outlives the ten seconds, and pointer motion on the lock screen starts another one every coalescing window. Sending SIGKILL to the group makes the bound unconditional; neither a blank nor a wake has anything to clean up.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 14, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

This had stopped merging cleanly with quattro. It is up to date again and has been re-verified on an Omarchy worker VM. Two commits were pushed to the branch.

What changed on the branch

  • a05ecd7c merges quattro at 58a289e2. quattro now pauses the fingerprint reader while the displays are off: runBlank() calls pauseFingerprint(), and runWake() calls resumeFingerprint() and nudgeFingerprint(). Those calls run on every request, coalesced or not. The coalesced spawn moves to the end of runWake(), because lock-blank-fingerprint-test.sh matches the function body with [^}]*, and the spawn's own block would end that match before resumeFingerprint().
  • 5e32d660 changes both detached spawns to timeout --signal=KILL 10s. timeout signals the child's whole process group, but plain timeout sends SIGTERM, which kills bash -c and then timeout exits. A grandchild that ignores SIGTERM therefore outlived the ten seconds, and pointer motion would start another one every coalescing window. --kill-after does not help, for the same reason: timeout has already exited. SIGKILL to the group makes the bound unconditional. A blank or a wake has nothing to clean up, and brightnessctl -s saves its state before it changes anything.

Verified on a worker (shell linked to each tree, with quickshell -p confirmed to be serving it). omarchy-brightness-keyboard was made to hang once on off while ignoring SIGTERM. The session was then locked, and later blanks and wakes were driven with Escape keypresses on the lock surface:

  • quattro at 58a289e2: DPMS stayed on through the first blank and two more, and the hung child was still running at the end. This is Display never blanks after lock: blank/wake silently stops working in a long-running shell #7652.
  • This head: the second and third blanks turned DPMS off, each wake turned it back on, and the hung child was gone once the timeout passed.
  • lock-blank-spawn-test.sh passes here and fails on quattro and with the fix reverted. ./test/cli is green. All 19 lock-related test/shell.d files pass, as does video-background-test.sh. The two quattro failures noted last time are gone.

Second opinion: Codex Medium reviewed two rounds. The first round found the SIGTERM-only bound, which 5e32d660 fixes. The second round found nothing open: it checked that SIGKILL to timeout's own process group reaches only the spawned tree and harms neither a healthy blank nor a wake. It also agreed the merge keeps quattro's fingerprint, sleep, stranded-lock and screen-change behaviour. Independence is not guaranteed, since it could read this session's reasoning.

#7179 and #6642 still edit runWake() and runBlank() and will conflict textually. Neither fixes this bug or changes how the spawns run.

Waiting on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 25, 2026
omarchybot and others added 3 commits October 31, 2026 21:30
quattro dropped the lock's displaysBlank and monitorDpms bookkeeping when the locked video wallpaper became a still frame (#15289), so runWake() keeps only quattro's fingerprint calls ahead of the coalesced spawn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It matched the exact execDetached and forceWake lines in Service.qml, so it guarded nothing but their wording. quattro's AGENTS.md now rules such tests out and #16334 removed the rest; the fix is proved by running a hung blank child on a worker instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stubs make the first keyboard-off hang, and the fixture blanks twice; the second blank must still reach omarchy-brightness-display. On quattro the reused blankProcess stays running, so the second blank is skipped and the test fails. It extends the existing lock service fixture rather than adding a file, and needs no compositor or display.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: muse-wonder High <noreply@meta.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review and removed verified Omarchy Triage has verified that this issue is ready for final review labels Oct 31, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review and removed verified Omarchy Triage has verified that this issue is ready for final review labels Oct 31, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

This had stopped merging cleanly with quattro. It is up to date again, re-verified on an Omarchy worker VM, and four commits were pushed to the branch.

What changed on the branch

  • 4c61d8a7 merges quattro at e4fffc6e. quattro dropped the lock's displaysBlank and monitorDpms bookkeeping when the locked video wallpaper became a still frame (Show a video wallpaper's still frame on the lock screen instead of playing it #15289), so runWake() now keeps only quattro's fingerprint calls ahead of the coalesced spawn. Nothing else in Service.qml conflicted.
  • 7c9364c0 deletes test/shell.d/lock-blank-spawn-test.sh. It only regex-matched the new lines in Service.qml, and quattro's AGENTS.md now rules out tests that read source text.
  • c01fb95d replaces it with a behavioural check in the existing lock-fingerprint-service-test.sh fixture. Stubbed brightness commands make the first blank hang, and the fixture blanks twice. The second blank must still reach omarchy-brightness-display off. The hung child's process group is killed on exit.
  • 34d2b9c0 rewrites the comment above runWake() so it describes the code, not what the code replaced.

Verified on a worker, with the shell linked to each tree and quickshell -p confirmed to be serving it. omarchy-brightness-keyboard was made to hang once on off while ignoring SIGTERM. The session was then locked, and wakes were driven with Escape on the lock surface:

  • quattro at e4fffc6e: DPMS stayed on through the first blank and both later ones, and the hung child was still running at the end. This is Display never blanks after lock: blank/wake silently stops working in a long-running shell #7652. Reverting the fix gives quattro's Service.qml exactly.
  • This head: blanks 2 and 3 turned DPMS off, each wake turned it back on, and the hung child was gone once the 10-second bound passed.
  • The new fixture check passes here and fails on quattro with "a blank whose child hangs does not stop the next blank".
  • ./test/cli is green, and every lock, sleep-lock and idle-spawn file in test/shell.d passes. A full ./test/shell run had 5 failures, in ascii-test, branding-about-animation-test, first-run-test, remote-session-service-test and runtime-smoke-test. All five fail the same way on quattro at e4fffc6e and are unrelated to the lock.

Second opinion: Codex Medium and muse-wonder (via pi, thinking high) reviewed five rounds. Round 1 found no defect in Service.qml, and both asked for a behavioural test in place of the deleted one. Codex then found two defects in that test, both fixed before the push: the hung child outlived the test, and the cleanup trap could abort before Quickshell was stopped when the child had already exited. The last two rounds found nothing open. Independence is not guaranteed, since the reviewers could read this session's reasoning.

Related: #16368 also edits runBlank(), and it keeps the reused blankProcess behind if (blankProcess.running) return. If both land, that guard has to go when the second is rebased, or #7652 comes back for blanks. #6642 removes omarchy-brightness-display off from the blank command, which is the opposite choice on whether blanking controls DPMS. #7179 edits the same functions for the fingerprint reader and will conflict only textually. #6538 has since closed.

Waiting on the maintainer.

@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, and the previous wake-test coverage gap is addressed.

Summary

The PR replaces reused display-control processes with detached commands limited to ten seconds.

  • The lock screen keeps blanking and waking after a display command gets stuck.

Reviews (2) · Last reviewed commit: "Cover the lock's wake path with a hung w..." · Reviewed by Greptile

Comment thread shell/plugins/lock/Service.qml Resolved
The behavioural check only drove runBlank(), so a wake that latches behind a hung child, an unlock wake swallowed by the coalescing window, or input forking one wake per event would all pass. The first omarchy-system-wake now hangs too, and two forceWake() calls followed by two runWake() calls must land exactly one wake.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review and removed verified Omarchy Triage has verified that this issue is ready for final review labels Oct 31, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Another round on this, aimed at what was still weakest: the evidence and the open questions. One commit was pushed to the branch.

What changed on the branch

  • 1a9bdbde covers the wake path in test/shell.d/lock-fingerprint-service-test.sh, which Greptile pointed out was untested: the behavioural check only drove runBlank(). The first omarchy-system-wake now hangs as well, then the fixture calls forceWake() twice and runWake() twice, and exactly one wake must land. On an Omarchy worker VM this passes at this head and fails with the fix reverted, with forceWake() no longer bypassing the coalescing window, with the coalescing guard removed (three wakes land), and with the old latched wakeProcess restored beside the new blank code. No hung child outlives the test.

The suite

The five ./test/shell failures reported last round were the worker's environment, not code: ascii and branding-about-animation ran under a POSIX locale, first-run saw a synced worktree whose .git pointed nowhere, and remote-session-service and runtime-smoke pass on their own. With a UTF-8 locale and a real .git, at this head ./test/cli passes 125 of 125 and ./test/shell passes 7216 checks with none failing. One file, agent-account-exec-test.sh, still exits 1 when its offline mise reshim finds no versions, and it does the same on quattro at e4fffc6e and at 620fd0c2, so it is not this change. CI is green.

Review

Codex Medium reviewed the new commit and the whole diff against quattro and found no defect. It asked for one style change, an explicit else in the wake stub, which is folded into 1a9bdbde. Its independence from this session is not guaranteed.

Still open

This waits on the maintainer.

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display never blanks after lock: blank/wake silently stops working in a long-running shell

2 participants