Skip to content

Keep the lock usable after an NVIDIA suspend's VT switch - #17277

Merged
dhh merged 3 commits into
quattrofrom
worktree-lock-focus-after-vt-switch
Nov 1, 2026
Merged

dhh merged 3 commits into
quattrofrom
worktree-lock-focus-after-vt-switch

Conversation

@dhh

@dhh dhh commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

On the NVIDIA N1x, the lid-open resume had two problems:

  • The lock screen ignored the keyboard until the password field was clicked.
  • The lock went dark again just as the panel came back.

Why

The NVIDIA driver forces a VT switch around every suspend and resume (pm_vt_switch_required(dev, true) in nvidia-drm). Hyprland drops the seat and restores it, so every input device is removed and added again.

  • Lost focus. When the keyboard goes away, Qt clears the lock window's active focus item, and nothing sets it back when the keyboard returns. Hyprland still delivers keys, but the TextInput no longer holds focus, so they go nowhere. A click (activeFocusOnPress) was the only way back. A traced Ctrl+Alt+F2 → F1 round trip while locked reproduces this without suspending: activeFocusItem goes to null and stays there.
  • Early blank. The idle-blank countdown that a suspend freezes is re-armed as soon as the kernel thaws. On NVIDIA the panel only lights a few seconds later, after the VT switch and a modeset. The 5s re-arm therefore blanked the lock shortly after it appeared, and the wake that followed cost another modeset.

Changes

  • LockView.qml: whenever the window's active focus item changes and the field should be taking keys but isn't holding focus, give focus back to the password field. It skips the restore while a password is being checked, because the field is disabled then.
  • Service.qml: after a resume, the first blank countdown is 15s instead of 5s.

Testing

  • Focus fix: a VT round trip while locked, then typing the password without the mouse, unlocks. The journal showed focus restored 5ms after the switch.
  • Resume blank: not yet checked with a real lid close.
  • Tests: lock-state-test.sh, lock-appear-budget-test.sh and lock-fingerprint-retry-test.sh pass.

🤖 Generated with Claude Code

dhh and others added 2 commits November 1, 2026 19:25
The NVIDIA driver forces a VT switch around every suspend, which takes the
keyboard away; Qt drops the field's focus with it and nothing restores it, so
typing after a lid-open resume went nowhere until the field was clicked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The countdown restarts as the kernel thaws, seconds before the panel lights
on NVIDIA, so the lock went dark again just as it appeared.

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

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous finding is fixed and no new actionable issues were found.

Summary

Keeps the lock usable after NVIDIA suspend and resume.

  • The password field regains focus when the lock window's focus changes.
  • The lock waits longer before blanking after a detected resume.

Reviews (2) · Last reviewed commit: "Hold off the blank after a resume that f..." · Reviewed by Greptile

Comment thread shell/plugins/lock/Service.qml Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mudiam

mudiam commented Nov 2, 2026

Copy link
Copy Markdown

Tested on different NVIDIA hardware than the N1x: Lenovo ThinkPad P17 Gen 1, Quadro T1000 only (no iGPU in use), S3 deep suspend, driver 615.78.08 (open modules), kernel 7.2.15, Omarchy 4.5.0-rc3. It fixes the lost focus here too.

Each cycle: suspend from Super+Esc, resume, type the password without clicking.

Field took keys without a click
rc3 as shipped 0/1 (needed a click)
rc3 + this PR (LockView.qml and Service.qml) 3/3

The sleep-inhibitor fix from #13782 was also applied in every run, so the lock was secure before each suspend. Not tested: a wrong password, or the early-blank timing.

This is the same bug #8560 fixed on this machine, so #8560 may be redundant now.

This PR isn't in 4.5.0-rc3; neither is #14496 (gvfs after resume, merged the day before rc3's backport). With #14496's hook on rc3, the gvfs FUSE mount was back after each of the 3 resumes. Could both be considered for the next 4.5 RC?

rdoupe pushed a commit to omarchy-asus/omarchy that referenced this pull request Nov 3, 2026
* Give the lock's password field its focus back after a VT switch

The NVIDIA driver forces a VT switch around every suspend, which takes the
keyboard away; Qt drops the field's focus with it and nothing restores it, so
typing after a lid-open resume went nowhere until the field was clicked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Hold off blanking the lock for longer after a resume

The countdown restarts as the kernel thaws, seconds before the panel lights
on NVIDIA, so the lock went dark again just as it appeared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Hold off the blank after a resume that found the lock already dark

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 1843592)
rdoupe added a commit to omarchy-asus/omarchy-asus that referenced this pull request Nov 3, 2026
… typing after an NVIDIA VT switch (omacom/omarchy#17277) (#396)

* omarchy + omarchy-settings 4.5.0rc3-1.102 (RC): the lock screen takes typing after an NVIDIA VT switch

Carry omacom/omarchy#17277 "Keep the lock usable after an NVIDIA suspend's
VT switch" as patch 0028: upstream's squash merge 1843592f21 on quattro,
taken as is (fork commit ad050862 on asus/v4-5-0-rc2). It merged 34 minutes
before v4.5.0-rc3 was tagged but isn't on the 4.5 line, so the RC build
lacked it.

On the G16, after a locked suspend-then-hibernate that resumed from disk
(Hyprland lost DRM master), the lock ignored typing until the field was
clicked, even with the Hyprland seat-leave patch. That patch stays: it also
re-activates other Qt windows, which #17277 doesn't touch.

Drop when an Omarchy 4.5 release we build from contains #17277.

Refs #393
Refs #302

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* omarchy + omarchy-settings: watch omacom/omarchy#17277 in UPSTREAM_PRS

The PR 0028 carries goes in both recipes' UPSTREAM_PRS, kept across
rebases, so the daily upstream check reports it until the patch drops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: rdoupe <1207041+rdoupe@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
rdoupe added a commit to omarchy-asus/omarchy-asus that referenced this pull request Nov 5, 2026
…0; drop the webcam guard and lock focus patches upstream now ships (#410)

* omarchy 4.5.0-3.101 (RC): rebase onto Omarchy 4.5.0; drop 0014-0015 and 0028, upstream ships them

Omarchy v4.5.0 contains omacom/omarchy#15910 (7388fe251, the webcam menu
guard answered from udev) and omacom/omarchy#17277 (00e4a1223, the lock
takes typing after an NVIDIA VT switch), so patches 0014-0015 and 0028 go.
The other patches apply to 4.5.0 unchanged. docs/deltas.md moves 0028 and
RC's 0014-0015 to Dropped; Quattro still carries 0014-0015.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* omarchy-settings 4.5.0-3.101 (RC): rebase onto Omarchy 4.5.0; drop 0014-0015 and 0028, upstream ships them

The same patch list as omarchy (one release cohort): omacom/omarchy#15910
and omacom/omarchy#17277 are in v4.5.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: rdoupe <1207041+rdoupe@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
berenddeboer pushed a commit to berenddeboer/omarchy that referenced this pull request Nov 6, 2026
* Give the lock's password field its focus back after a VT switch

The NVIDIA driver forces a VT switch around every suspend, which takes the
keyboard away; Qt drops the field's focus with it and nothing restores it, so
typing after a lid-open resume went nowhere until the field was clicked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Hold off blanking the lock for longer after a resume

The countdown restarts as the kernel thaws, seconds before the panel lights
on NVIDIA, so the lock went dark again just as it appeared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Hold off the blank after a resume that found the lock already dark

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 1843592)
omarchybot added a commit to robouk/omarchy that referenced this pull request Nov 16, 2026
quattro's omacom#17277 restores the password field's focus when the lock window's focus item changes; this keeps that handler and this branch's post-check refocus side by side.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants