Repository navigation
Conversation
The lock surface outlives a suspend, so the focus the password field takes when the view is built can be gone by the time the machine resumes: the compositor rebuilds the keyboard on the way back, and the view is never rebuilt to take focus again. Only a click restored it. The display is blanked by then, so waking the screen with a mouse move lit the panel but left the field swallowing keystrokes until the user clicked it. Handle the wake signal itself, so every wake path recovers focus rather than just the one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019q6kd5nX4D8xS7jy7KJYtP
|
Closing as a duplicate — I should have listed the open PRs before opening this one. #7592, #8560 and #8869 all predate it and diagnose the same thing. For anyone triaging: #8560 covers the most cases of the four. This PR only refocused on Confirmed the underlying bug on real hardware (AMD laptop, single eDP panel, Hyprland, omarchy 4.0.1): |
Symptom
After resuming a laptop from suspend, the lock screen sometimes ignores keystrokes. The password field looks normal but swallows everything typed until you click it. Locking manually is unaffected — it only shows up coming back from sleep.
Cause
omarchy-system-sleep-locklocks before suspending and waits forsecure, so the session lock is already up when the machine goes down. The journal shows the lock surface then outlives the suspend — there is no secondlock-requested/secure=trueon the way back:So
LockViewis never rebuilt, and itsComponent.onCompletedfocus never runs again. Meanwhile the compositor tears down and rebuilds the keyboard across the resume (an xkb keymap recompile lands ~5s after wake), which is where the field's keyboard focus goes.That left
MouseArea.onClickedas the only thing that could restore it:idleBlankTimerhas DPMS'd the display off by then, so you have to interact to see anything at all. Move the mouse and the panel lights up with an unfocused field; click and it works. Hence the intermittence — it depended on whether you happened to click or just move.Fix
Handle the wake signal itself, so every wake path recovers focus instead of just one:
The click handler no longer needs to special-case focus. Guarding on
inputEnabledkeeps the lock preview — which reuses this view with input disabled — from focusing a field the user cannot type into.Testing
Adds
test/shell.d/lock-password-focus-test.sh, following the existing headlessLockViewfixtures. It focuses the field, drops focus the way a resume does while the view stays alive, wakes, and asserts focus came back; it also asserts waking does not focus the field whileinputEnabledis false. Verified it fails without the change:./test/shellpasses 211/216. The 5 failures (config,snapper,theme-install-guards,unowned-system-paths,windows-vm-mount-boundary) reproduce unchanged on a clean checkout of master on this machine and are unrelated.Not verified on real hardware across a live suspend/resume yet, since that needs a locked session to reproduce in the act — the automated coverage stands in for it.