Skip to content

Drop key auto-repeat in the lock screen password field - #7806

Merged
dhh merged 1 commit into
omacom:quattrofrom
berndb:lock-ignore-autorepeat
Oct 4, 2026
Merged

dhh merged 1 commit into
omacom:quattrofrom
berndb:lock-ignore-autorepeat

Conversation

@berndb

@berndb berndb commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #7805.

Waking a DPMS-blanked lock screen with a keypress can stall the compositor for seconds while slow displays modeset (Apple Studio Display: 2–4 s). The wake key's release only reaches the lock surface after the stall, and since Wayland key repeat is client-side, the password TextInput types the held character at the repeat rate for the whole stall — leaving the field pre-filled with dozens of masked dots. Enter then fails and the user has to clear and retype (details and journal evidence in the issue).

A held key has no legitimate role in typing a password, so the field now drops auto-repeat key events. Backspace and Delete keep repeating, so holding Backspace to clear the field still works. Escape and Ctrl+U continue to clear in one stroke.

Verified on the affected machine: locking, letting the screen blank, and briefly tapping a letter key reproduces the flood deterministically without this change, and waking with Shift leaves the field empty — confirming the pile is client-side repeat of the wake key.

Tests: new test/shell.d/lock-autorepeat-test.sh covers the repeat policy via a LockView fixture (character/Return/Escape repeats dropped, Backspace/Delete kept). ./test/all run against a live compositor: all lock tests pass; the only failing files (config, runtime-smoke, snapper, unowned-system-paths) fail identically on unmodified quattro on this machine, so they are pre-existing and unrelated.

Copilot AI balanced review requested due to automatic review settings August 22, 2026 18:22

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

Prevents lock-screen password flooding by ignoring auto-repeat events except Backspace and Delete.

Changes:

  • Filters repeated password-field key events.
  • Adds a Quickshell fixture and shell test for the repeat policy.

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 3 out of 3 changed files in this pull request and generated no comments.

File Description
shell/plugins/lock/LockView.qml Filters unwanted auto-repeat events.
test/shell.d/lock-autorepeat-test.sh Runs the lock repeat-policy test.
test/shell.d/fixtures/lock-autorepeat/shell.qml Verifies dropped and retained keys.

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

@itissdr

itissdr commented Aug 23, 2026

Copy link
Copy Markdown

Found this same problem on my HP Probook 14 yesterday. Ditched my own proposed fix in favor of this one, I had not bothered to allow for backspace, etc.. Merged and tested on my hp with devlink.

@ClGratton

ClGratton commented Aug 26, 2026 •

Copy link
Copy Markdown

Confirmed the underlying failure and this fix on another slow dual-DisplayPort setup:

  • Omarchy 4.0.1-1 / Hyprland 0.56.2-1
  • NVIDIA RTX 3080 Ti
  • two 2560×1440 high-refresh DP monitors (DP-1 180 Hz, DP-3 200 Hz)
  • foot 1.27.0-2

With both outputs DPMS-off at the lock screen, one physical Space press woke them but left about seven dots in the password field. A temporary lock-service harness recorded repeated wakeRequested activity for roughly three seconds while Hyprland already reported both outputs dpmsStatus=true, consistent with the delayed-release/client-side-repeat diagnosis here.

Applying this PR's event.isAutoRepeat filter verbatim to a cloned omarchy.lock reduced the field to the single original Space, confirming the patch on this hardware.

One optional UX extension: many lock screens treat the first key after DPMS blank as wake-only. I locally tested a small state handoff where runBlank() arms discardNextWakeKey; the first non-repeat key is accepted/consumed and clears that flag, while pointer wake clears the flag so the first subsequent password character is preserved. That leaves the password field empty after Space-to-wake. This is separable from the correctness fix in this PR—the auto-repeat filter is valuable and confirmed either way.


Scope correction (2026-08-28): The auto-repeat evidence above establishes the password-field flooding mechanism only. It does not establish why the physical displays can briefly show the lock prompt and then go black again. On this same machine, that display symptom persisted after the input filter was applied. The lock plugin independently starts a hardcoded 5-second blank timer on wake, and slow DisplayPort link training may consume most or all of that window; this is being tested separately against #7399. Please treat the input filter in this PR as an independent, still-confirmed fix.

@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 Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and reproduced; nothing found that needs changing.

Reproduction, on a disposable Omarchy worker (stock ISO desktop, Hyprland, the shell linked to the tree under test), with this branch merged onto current quattro (97a9fce). I locked with omarchy-system-lock, let the lock blank the display, then held a for two seconds through a virtual keyboard to stand in for the late release a slow modeset causes:

  • quattro alone: the password field filled to its width with dots.
  • quattro + this PR: one dot.
  • The same merge with LockView.qml put back to quattro's version: the field filled up again.

On this branch, typing eight characters and then holding Backspace emptied the field, so repeat-to-clear still works.

Tests on the worker: the lock shell tests (lock-*-test.sh, including the new lock-autorepeat-test.sh) pass on the merge. ./test/cli passes too, apart from two vscode-theme assertions that fail the same way on quattro without this change. The new test checks dropsAutoRepeat()'s answers rather than the Keys.onPressed wiring, so the reproduction above is the evidence that the handler actually works.

Second opinion: Codex Medium reviewed the diff and the merge with current quattro. It confirmed that accepting the event in Keys.onPressed stops the insertion, since Keys.priority defaults to BeforeItem. It pointed out that held arrow keys also lose repeat, which follows from the policy this PR describes, and that the test does not cover the wiring. After a second round it found nothing that blocks. It had access to my reasoning, so its agreement is not guaranteed to be independent.

Related: #9211 and #11858 also change this Keys.onPressed handler. They drop the key that wakes a blanked display, not the repeats that come after it, so they complement this PR rather than compete with it, but whichever lands second will need a small rebase. This PR closes #7805.

This now waits on the maintainer.

@jmmon

jmmon commented Oct 1, 2026

Copy link
Copy Markdown

Full data is on #7805 — posting here so the measurements are visible from the PR.

Independent hardware to the report: Dell XPS 15 9530 (i915) → USB-C dock → VG3448 at
3440x1440, Omarchy 4.0.0.r1832. One tap of Space on a blanked lock screen → 14
characters unpatched, 1 with this PR
(panel takes ~4.3s to wake; the count scales with
the stall). Backspace exemption verified too: holding Backspace gives 56 events / 54
auto-repeat and clears the field, so the exception is load-bearing.

One mechanism detail I'd suggest adding to the description, since it's the premise the
fix rests on — the release event itself arrives carrying autoRepeat=true:

0.0ms pressed autoRepeat=false textLen 0→1
261.0ms released autoRepeat=true ← release itself flagged as repeat
262.0ms pressed autoRepeat=true textLen→2
... 13 more, at exactly 25ms spacing ...
578.0ms released autoRepeat=false ← real key-up finally arrives

25ms is Qt's client-side repeat rate exactly, so the repeats are generated by
Quickshell/Qt rather than sent by the keyboard — the stall delays the release instead.

On the leftover "1 is not 0": #11858 and #9211 both swallow the wake key and both are
currently blocked on a stale displaysBlank flag — a volume or brightness key is a
locked = true bind, so Hyprland consumes it, the lock never sees it, and the flag stays
set on a lit screen, making the next real keypress clear the field and get swallowed.
Flagging so it isn't picked up as a quick follow-up.

@dhh
dhh merged commit 00cee6d into omacom:quattro Oct 4, 2026
buger added a commit to probelabs/omarchy that referenced this pull request Oct 4, 2026
Upstream omacom#7158 and omacom#7806 added probe classification, attempt pacing and
backoff, the reach timeout, the sleep watcher, the unavailable state and
auto-repeat dropping in the password field. The harness now drives them:

- on a real lock, the fprintd-list stub answers unknown, yes, no and a
  two-reader answer, and new PAM fixtures stand in for the reader: one
  that only sends an error message (nologin), one that prompts and waits,
  one that never answers. Probe and attempt streaks build to the
  unavailable report, a prompt clears it, user input shortens the probe
  backoff, and stalling the event loop past the watcher interval plays a
  suspend with an attempt in flight.
- crafted attempt state covers the fast-error window, the resume grace,
  retry nudges and restarts, as the upstream service fixture does.
- real held keys on the lock surface: a held letter types once, held
  Backspace and Delete keep erasing.
- helper commands run through a queue, so a fixture swap or stub flip is
  never dropped while the previous one is reaped.

Requirement-level witnesses for SW-REQ-261004-V813, -296X and -VVN2 sit
next to their assertions; the structurally impossible violation rows are
dispositioned defensive, citing new spec-conformance reviews.
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge 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.

Lock screen password field fills with key repeats when a keypress wakes slow DPMS-blanked displays

8 participants