Skip to content

Swallow the keystroke that wakes a blanked lock screen - #9749

Closed
LorenzGit wants to merge 1 commit into
omacom:quattrofrom
LorenzGit:fix/lock-swallow-wake-keystroke
Closed

LorenzGit wants to merge 1 commit into
omacom:quattrofrom
LorenzGit:fix/lock-swallow-wake-keystroke

Conversation

@LorenzGit

Copy link
Copy Markdown

Bug Description

When the lock screen has blanked the display (idle blank, or after sleep), the first key that wakes it is inserted into the password field. Space is the obvious case — a lone dot before you have typed anything — but every character does it. Unlock then fails, or you backspace first.

Holding that key also auto-repeats into the field once the display is considered awake.

Lid-close suspend often wins the race against the lock's five-second blank timer, so the same first-key-is-password bug happens after resume even when Omarchy never blanked the panel itself.

Root Cause

LockView's Keys.onPressed always calls wakeRequested() and then lets the event fall through to the TextInput. Nothing records that the panel is dark, so a wake keystroke is indistinguishable from the first character of the password.

Fix

  • The lock tracks displayBlanked in runBlank() / runWake() and hands it to the view.
  • The view samples that flag before wakeRequested() clears it, accepts the event, and keeps swallowing auto-repeats until that key is released.
  • Escape and Ctrl+U still clear the field and return before the swallow.
  • omarchy-system-sleep-lock blanks the panel once the session is secure, so the frozen QML state still says "blanked" on the first key after resume.

Mouse wake is unchanged. Typing after the display is on is unchanged.

Related: #7805. Adjacent open PRs #9157 (dirty fork) and #9211 (does not mark blanked on suspend, and does not swallow auto-repeats).

How to Verify

  1. Lock (Super+Escape), wait for the display to blank (~5s), press Space. The field should stay empty; the next character should be the first password dot.
  2. Lock, wait for blank, hold a letter. The field should stay empty until you release and type again.
  3. Close the lid (or suspend), open it, press a key. That key should wake the panel and not appear in the field.

Test Plan

  • Added test/shell.d/lock-wake-keystroke-test.sh and sleep-lock coverage for the blank IPC
  • ./test/cli passes
  • Focused lock/sleep tests pass (lock-wake-keystroke, sleep-lock, lock-blank-fingerprint)
  • Manual verification of the fix on hardware (please try a lock-blank and a lid-close cycle)

Risk Assessment

Low — only the lock password field and the pre-suspend blank. A key pressed while the panel is lit still types. A failed lock blank IPC is ignored so suspend is not blocked.

A key at a dark lock panel is there to wake it, not to start the password.
Lid-close suspend also marks the panel blanked so the same holds after resume,
and auto-repeats of that key are ignored until it is released.
@LorenzGit

Copy link
Copy Markdown
Author

Closing for now.

This patch was never loaded in the reporter's running session (OMARCHY_PATH=/usr/share/omarchy). The session lock that required a reboot happened while ./test/shell was instantiating extra Quickshell processes on the live compositor, which the suite is not supposed to do on a development machine.

Will reopen after VM verification, not live-session testing.

@LorenzGit LorenzGit closed this Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant