Repository navigation
Refocus the lock password field after resume - #7592
RovshanMuradov wants to merge 1 commit into
Conversation
The lock surface stays mapped across suspend, so onCompleted never runs again. Resume drops Qt activeFocus; a click already restored it.
There was a problem hiding this comment.
Pull request overview
Restores password-field focus after resume by retrying focus while the lock screen is idle.
Changes:
- Adds a repeating focus-recovery timer.
- Pauses retries during password authentication.
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.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| running: root.inputEnabled && !root.authenticatingPassword && !passwordInput.activeFocus | ||
| onTriggered: root.forcePasswordFocus() |
The refocus fired once, from `Qt.callLater` on the blanked flag going false. That flag clears the moment `runWake()` is called, before `omarchy-system-wake` has even started, let alone before Hyprland has re-enabled DPMS and handed the lock surface its keyboard focus back. The call therefore lands on a display that is still off, and nothing tries again: on hardware slower to return focus than this one, the wake lights the panel and the field stays deaf anyway. Retry instead, on a short timer bound to the field's own `activeFocus`, so it stops itself the moment focus lands. It idles while the display is blanked, where there is no focus to win and a lock can sit for hours. omacom#7592 fixes the same early-focus problem from the resume side with the same shape of timer, minus the blanked gate. If that lands first, this one should go.
|
Tested the retry-timer approach from #7592 on the current stable release: it fixes the resume case here, and a focus trace shows where the focus is lost. Setup: Omarchy 4.0.4-1, Hyprland 0.56.2-2, aquamarine 0.15.0-2, quickshell 0.3.1-1, kernel 7.2.5. ASUS ROG Zephyrus G15 (GA503QS), single internal eDP on the AMD iGPU (Cezanne, Symptom on stock 4.0.4: after lid-open resume the password box is shown, but typing does nothing until the box is clicked. Reproduced 4 of 4 times. Patch tested: in Trace from one cycle (journal): The lock window goes inactive when the seat is disabled for suspend, and Hyprland's log for the same resume also shows |
|
hey, this is already covered in #12894 (lock keyboard focus after resume). mind closing this as a duplicate? |
|
Reviewed this against #12435, which fixes the same bug a different way. Both work; #12435 is the one I've recommended to the maintainer. Reproduced on a disposable Omarchy VM (Hyprland, Quickshell, this PR merged into Why #12435: it reacts to that exact transition (the window's active focus item becoming null) instead of retrying on a 100 ms timer, and it adds a regression test ( Codex (medium) was asked separately which of the two to bring forward, and also chose #12435, for the same reasons. It found no defect in either. Its independence from this review is not guaranteed. Claude Opus 5.5 did the review and the VM testing. Which of the two lands is the maintainer's decision, so this waits on them. Nothing is needed from you in the meantime. |
|
Thank you for this, @RovshanMuradov. #12435 fixes the same problem in a way the review judged better, so this is closed in favour of it. If it does not cover your case, please say so there. Closed at the maintainer's request. The review comment above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent. |
Problem
After suspend, the lock screen shows the password field but keystrokes do nothing until any mouse click. The keyboard is alive; Qt activeFocus on the field is not.
Reproduce
Why v3 worked
Omarchy 3 locked with hyprlock, which reads raw Wayland keys. Quattro (7ea4e1a Switch hyprlock to QS) replaced that with a Quickshell TextInput. Focus is set on Component.onCompleted, inputEnabled, and click. The lock stays mapped across suspend, so onCompleted never runs again. Click already called forcePasswordFocus(); nothing else did.
Fix
While the lock is up, idle, and the field has no activeFocus, a short timer calls the same forcePasswordFocus() path as a click. Stops once the field is focused; does not run during PAM.
Verified: suspend → wake → type with no click.