Skip to content

Blank a locked session's displays again after they are lit behind the lock - #16368

Open
omarchybot wants to merge 3 commits into
quattrofrom
fix/issue-15897
Open

omarchybot wants to merge 3 commits into
quattrofrom
fix/issue-15897

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

A locked session's panels could come back on and stay on the lock screen for hours. The lock arms its five-second blank only when it first locks and when it wakes the displays itself, and two things lit the panels without going through it:

  • The idle service woke them. Idle cycles keep running while locked. When one ended, cancelIdleCycle() ran omarchy-system-wake, which turns every output on, and the lock never heard about it. In the reporter's second log that is the idle-cycle-cancel: activity → process-start: wake omarchy-system-wake at 01:17:47, followed by an hour and a half of lit panels. The wake now runs only when the session is not locked, the same guard the screensaver launch beside it already uses. While locked, the lock owns the displays: it wakes them on input and blanks them again.
  • Nothing blanked them again. omarchy-shell lock lock on a session that was already locked did nothing about the displays, so the idle service's lock every cycle, and omarchy-system-sleep-lock before a suspend, left lit panels lit. That is despite omarchy-system-lock being described as "Lock the computer and turn off the display". Every lock request now re-arms the blank, so panels lit by a resume or by Hyprland's own DPMS go off again within five seconds of the next request.

Blanking can now repeat without a wake between. omarchy-brightness-keyboard off saves the current level before setting 0, so a second blank would save the 0, and every restore after it would bring back a dark keyboard. Only the first blank since a wake turns the keyboard backlight off.

Not covered here: panels lit with no input and no later lock request still have nothing to blank them until one comes. Closing that needs the lock to watch DPMS itself. The pointer half of the report (motion on the lock surface waking the panels with misc:mouse_move_enables_dpms = false) is a separate behaviour, and #15342 and #11991 are open for it.

Fixes #15897

… lock

The lock arms its five-second blank only from beginLock() and its own wakes. An idle cycle that ended while the session was already locked ran omarchy-system-wake, lighting the panels without the lock knowing, and the next idle lock found the session locked and did nothing, so the panels stayed on the lock screen for hours. The idle service now leaves a locked session's displays to the lock, and every lock request re-arms the blank, which also turns off panels lit by a resume or by Hyprland's own DPMS once the next request arrives.

Blanking can now repeat without a wake in between, and brightnessctl saves the keyboard level as it turns it off, so a second off would save the 0 and every restore after it would bring back darkness. Only the first blank since a wake turns the keyboard off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the remaining feedback concerns missing regression coverage.

Findings

  1. P2 Repeated blanks lack regression coverage ▶

Summary

The PR gives the lock control over waking and blanking displays while the session is locked.

  • Idle activity no longer wakes displays behind the lock.
  • Repeated lock requests blank displays again after five seconds.
  • A suspend near blanking lets the fingerprint reader recover on resume.

Reviews (2) · Last reviewed commit: "Watch for the resume when a held suspend..." · Reviewed by Greptile

Comment on lines +370 to +372
blankProcess.keyboard = !root.keyboardBlank
root.keyboardBlank = true
blankProcess.running = true

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 Repeated blanks lack regression coverage

The new keyboardBlank logic has no regression test. AGENTS.md requires a bug fix with logic to include a test that fails before the fix and passes afterward. This requirement must be met before merging.

Extend the existing lock tests to exercise two blanks without a wake, then a wake and another blank. Check that every blank turns off the displays, but keyboard brightness is saved only once between wakes. The current tests would not catch a broken keyboardBlank reset.

File Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 23, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Reviewed at f034677 and run on a worker VM built from the Omarchy ISO, with the shell serving this branch. No defects found.

What was run, through omarchy-system-lock, hyprctl dispatch and omarchy-toggle-idle, reading each display's DPMS state from hyprctl monitors:

  • A display lit behind the lock, then a second lock request. On quattro (967bbdd, this branch's parent) the display stayed on. On this branch it was off again within five seconds.
  • An idle cycle cancelled while locked and blank. On quattro it lit the display, which stayed on. On this branch the display stayed off.
  • An idle cycle cancelled while unlocked still wakes the display, so the new guard only applies to a locked session.

./test/cli passed. In ./test/shell, 7139 tests passed and 6 failed. Five of the failing files also fail on quattro on the same worker: ascii, branding-about-animation, omarchy-kernel, runtime-smoke, and lock-appear-budget, whose timing budget the VM missed on quattro in two of three runs. The sixth, i18n-startup, failed only in the full run and passed when run by itself. The worker cannot test the keyboard backlight half because it has no backlight. That part was checked by reading omarchy-brightness-keyboard, where off saves the current level with brightnessctl -s.

Second opinion from Codex Medium and muse-spark-1.3 (high). Neither found a defect. Both had access to the earlier diagnosis on #15897, so their agreement with it is not independent. They raised three things worth knowing:

  • keyboardBlank is cleared only by the lock's own wake. The keyboard backlight keys are bound with locked = true in default/hypr/bindings/media.lua, and omarchy-system-wake can also be run directly. If either lights the keyboard while the lock has it off, later re-blanks turn the displays off but leave the keyboard lit. quattro leaves it lit too, because it never blanks again, so this is not a regression. Fixing it means a way to set the keyboard to 0 without saving the level, which is a choice about omarchy-brightness-keyboard rather than a defect here.
  • Some things still light panels behind the lock and have nothing to blank them until the next lock request: the display brightness keys and omarchy-hyprland-monitor-internal on, for example. This is the gap the description already names.
  • If omarchy-shell lock isLocked gets no answer, the idle wake still runs. That matches the screensaver guard beside it, and it is the safe default: failing the other way would leave an unlocked desktop dark.

On Greptile's request for a regression test: none is added. The tests for this area check the QML source against regexes, and the repository's AGENTS.md rules out a test that greps for the line just added. The fixture that runs the real lock service (test/shell.d/fixtures/lock-fingerprint-service) deliberately avoids runBlank(), runWake() and lock(), because they drive the real displays and take the real session lock. A behavioural test would have to be a new graphical acceptance test that locks a VM. Whether that is worth adding is the maintainer's call.

This waits on the maintainer.

@chessing234 chessing234 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.

all good

@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 2 commits November 1, 2026 22:01
# Conflicts:
#	shell/plugins/lock/Service.qml
Every lock request now re-arms the five-second blank, including omarchy-system-sleep-lock before a suspend. When the panel was still lit, noteSleepRequested() did not start the resume watch, and if logind held the suspend past five seconds the blank paused the reader before the machine slept. The resume then lit the panel with nothing left to blank it again or bring the reader back. The sleep request is now remembered, and pausing the reader within its window starts the watch.

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

Copy link
Copy Markdown
Collaborator Author

This branch had fallen behind quattro and no longer merged, so I merged current quattro (e583e81) into it and fixed one defect that the merge exposed. The head is now 4a2fb5f.

The merge. One conflict, in shell/plugins/lock/Service.qml: quattro removed displaysBlank and the DPMS polling when it switched video wallpapers to a still frame on the lock screen. The resolution takes that removal and keeps only this fix's keyboardBlank flag and its reset in runWake().

The defect, now fixed (4a2fb5f). quattro also gained resume handling for the lock: a 15-second blank countdown after a resume, and a resume watch that noteSleepRequested() starts. That watch only started when the reader was already paused. Because this PR re-arms the 5-second blank on every lock request, omarchy-system-sleep-lock arriving while the panel was lit could blank it and pause the fingerprint reader before a suspend that logind held past five seconds. Nothing was then watching for the resume, so the panel could come back lit with nothing to blank it, which is #15897 again. The lock now remembers the sleep request, and pausing the reader within 20 seconds of it starts the resume watch. A check in the lock-fingerprint-service fixture covers this and fails with the service change reverted.

Run on a worker VM built from the Omarchy ISO, reading DPMS from hyprctl monitors:

  • A display lit behind the lock, then a second omarchy-system-lock: still lit 8s later on quattro e583e81, off on 4a2fb5f.
  • An idle cycle cancelled while locked: lights the blanked display on quattro, which stays lit 11s later. On 4a2fb5f it stays off.
  • An idle cycle cancelled while unlocked still wakes the display on both.
  • The held suspend itself was not run on the VM; the fixture check is the evidence for that path.

Tests. ./test/cli passes, and every lock, idle, sleep-lock and keyboard-brightness file in test/shell.d passes on 4a2fb5f. The full ./test/shell run on the merge had 7251 passing checks; 7 files failed. Six of them (agent-account-exec, ascii, branding-about-animation, first-run, remote-session-service, runtime-smoke) fail on quattro too, and channel-switch passed when run alone.

Second opinion. Codex Medium, with muse-wonder at high thinking alongside, reviewed the merge and found the held-suspend defect above independently. They reviewed the fix and found nothing further in the PR. Their independence from this review is not guaranteed. Both noted one case that is already on quattro and that this PR leaves as it was: a suspend that begins the lock, when securing the session takes more than five seconds, blanks with no resume watch either. Closing it would change how a first lock handles a sleep, so it is left for a separate change.

There is still no automated test for the re-arm on repeated lock requests or for the idle-wake guard. The area's fixture deliberately avoids runBlank(), because it would drive the real displays. Whether the worker reproduction is enough for those is the maintainer's call. CI's test job is still running.

@benwillems

Copy link
Copy Markdown

Thank you for reproducing this and for the lock/idle split.

I read the same two sites on current quattro (d5b32d24): cancelIdleCycle() still runs omarchy-system-wake while locked, and lock() still returns early when already locked, so a second request never re-arms the blank. Both of those still match the original report.

The CI test/shell failure on this branch is agent-usage-kimchi-test.sh and dropdown-test.sh, which do not touch lock or idle. I did not rerun those here.

I am not opening a second PR for #15897. Happy to help with a follow-up for the remaining case you noted (a panel lit with no later lock request, which needs the lock to watch DPMS).

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.

Locked panels come back on and stay on; the blank is armed only for the first lock

3 participants