Skip to content

Blank the displays again when a locked session is locked again - #19387

Open
Jitheswar wants to merge 1 commit into
omacom:quattrofrom
Jitheswar:lock-reblank-when-locked
Open

Jitheswar wants to merge 1 commit into
omacom:quattrofrom
Jitheswar:lock-reblank-when-locked

Conversation

@Jitheswar

Copy link
Copy Markdown

Fixes #19285.

Problem

omarchy system lock promises to lock and turn off the display. On a session that is already locked, the lock IPC only called noteSleepRequested(). The blank countdown (idleBlankTimer) is armed only by beginLock() and by input reaching the lock surface (runWake()). So once something lit the panels under the lock without touching that surface (a hyprctl dispatch dpms on from SSH or a script, or the idle service's own wake on a cancelled cycle), nothing turned them off again. The issue reports displays left on for about 13 hours overnight.

Fix

The already-locked branch of lock() now calls a new relock(). It keeps the existing noteSleepRequested() and also re-arms the blank countdown, unless a password check is in flight, matching the rule the countdown already follows.

This covers both paths in the issue:

  • An explicit omarchy system lock on a locked session blanks again after 5 s.
  • The idle service's next lock-timeout goes through omarchy-system-lock → lock(), so after a spurious idle wake under the lock the panels go dark by the next idle cycle at the latest, not at unlock.

omarchy-system-sleep-lock also calls lock before every suspend. Arming the countdown there is harmless: the existing wall-clock check in the timer turns a countdown frozen by suspend into the 15 s resume run-up, the same as for a fresh lock.

I left the idle service's omarchy-system-wake on cancel unchanged. Skipping or rerouting it while locked is a separate behaviour change, and with this fix its effect is now bounded.

Tests

  • Extended the existing lock-fingerprint-service fixture, which already drives the real Service.qml: a repeated lock arms the blank timer, and it doesn't arm while a password check is running.
  • Checked that the new assertion fails without the fix (with relock() doing only noteSleepRequested(), only "a lock request on a locked session blanks the displays again" fails) and passes with it.
  • bash test/shell.d/lock-fingerprint-service-test.sh and bash test/shell.d/lock-state-test.sh pass.

🤖 Generated with Claude Code

A lock request on an already-locked session only noted a possible
sleep, so displays woken under the lock without input reaching the
lock surface stayed on until unlock. Re-arm the blank countdown, unless
a password check is in flight.

Fixes omacom#19285

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Repeated lock requests now restart the display-blanking countdown while keeping the screen on during a password check.

  • Repeated lock requests start the display-blank countdown again.

No actionable issues found.

Reviews (1) · Last reviewed commit: "Blank the displays again when a locked s..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

I read the diff, lock and idle call paths, existing tests, and #19285 with GPT-6 High in Codex. I classify this as a bug, but DeepSeek v4p1 Flash returned no usable classification, so the classification remains unsettled. Tests and a substantive second review have not run. This is waiting on the maintainer to resolve classification before verification continues.

@omarchybot

Copy link
Copy Markdown
Collaborator

I compared this change with the earlier #16368, including both diffs, the lock and idle call paths, the keyboard-brightness helper, and #19285. They are competing implementations of the repeated-lock fix, so this stays open.

The earlier PR implements the same timer re-arm and also handles a suspend delayed beyond the blank countdown. Following the queue’s oldest-first rule for competing fixes, I’m carrying this PR’s focused repeated-lock/password-authentication checks and authentication guard forward for consideration in #16368, with credit to Jitheswar. This leaves the choice between them with the maintainer.

GPT-6 in Codex (reasoning effort not exposed) reviewed the comparison with Opus 5.5 High and muse-wonder via pi, thinking high. The two comparison reviewers differed on which approach to prefer; this is not a unanimous recommendation. No worker tests ran for this PR because it is waiting on that competing-fix decision. No code was pushed and it has not been marked verified.

omarchybot added a commit that referenced this pull request Nov 22, 2026
…blanks

Fold Jitheswar's repeated-lock guard and behavioural checks from #19387 into the earlier fix. A password conversation keeps the display lit without rearming its countdown. Extend the existing fixture to drive two blanks, wake, and blank again, observing the actual brightness dispatches while isolating hardware effects.

Co-Authored-By: Jitheswar <[email protected]>
Co-Authored-By: GPT-6 (Codex; reasoning effort not exposed) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy system lock on an already-locked session never turns the display back off

2 participants