Repository navigation
Conversation
61263eb to
ffd1338
Compare
ffd1338 to
ce0e022
Compare
|
BTW. I tried this on my local environment by copying the change and it solved my issue. |
ce0e022 to
992c4b8
Compare
|
Additional reproduction closely matching this focus-loss issue. On Omarchy 4.0.2 with Quickshell 0.3.1, Hyprland 0.56.2, NVIDIA driver 610.57.04, and four outputs, waking an idle-locked session left the lock UI partially rendered. The password field was visible on some monitors, but pointer/keyboard focus could not reliably be restored. Clicking the password field did not fix it in this case. The local journal showed simultaneous output-rendering failures: The installed LockView.qml already uses a full-surface MouseArea and calls forceActiveFocus() on click, so this appears to be beyond ordinary QML TextInput focus. It may involve Hyprland/session-lock input routing after output recreation, compounded here by the NVIDIA EGL allocation failure. |
|
Verified the same bug on a single-output NVIDIA desktop (Omarchy 4.0.3, Hyprland 0.56.2): lock taken before suspend, surface survives, typing does nothing until pointer input. A |
|
Reproduced on current stable Omarchy 4.0.4-1. Relevant environment:
Before the workaround, the password field required a pointer click before accepting keyboard input. I cloned After applying it, I verified keyboard-only unlock in all three cases:
This confirms the focus-loss symptoms and that repeated focus recovery covers this machine. I have not tested the #9181 branch itself, so this is supporting hardware/workaround evidence rather than a direct PR validation. |
|
Automated duplication check: this pull request looks similar to #8560, which covers the same lock focus restore on resume. I keep that one open and close this one to consolidate review. If you feel this is the wrong decision, please open the PR again with a note on the difference. |
Problem
After system resume, the visible password field can be left without keyboard focus. On multiple outputs, ext-session-lock surfaces may be recreated one after another. On a single output, the lock surface may survive suspend unchanged, so no screen-change callback occurs at all. A failed PAM attempt creates another focus-loss path because the password field is disabled during authentication and must be focused again after it is re-enabled.
Fixes #9180.
Cause
LockViewpreviously made one imperative focus request during construction. Quickshell constructs lock views before the compositor can grant keyboard focus, and recreated views have no declared focus scope to restore. The earlier version of this PR retried on secure state, screen changes, and PAM completion, but a single-output lock surface can survive sleep without any of those events firing after resume.Change
LockViewis now a keyboardFocusScopewith a declared focus target. The lock service sends explicit focus generations, acknowledges active focus, pauses while PAM owns a disabled field, and retries across sequential output recreation.The sleep monitor now remains alive across the complete logind sleep cycle. After a known
PreparingForSleep=false, it sends one genericresumeFromSleepIPC event to the lock service. Resume uses the complete twelve-second focus budget even if an early surface acknowledges focus. Unknown logind state never counts as resume, a vanished D-Bus producer is treated as failure, and the next delay inhibitor is armed before shell notification retries so a rapid second suspend remains protected.The retry never submits or modifies password contents.
Verification
The focused lock, monitor, and sleep tests pass. The complete shell suite ran all 226 files on the corrected #9181 branch; every affected test passed, with only the five existing host/baseline failures in
config-test,launch-about-test,runtime-smoke-test,snapper-test, andunowned-system-paths-test.A real dual-output S3 cycle on NVIDIA and DisplayPort exercised the explicit resume event. Both outputs remained active, the full focus budget ran after logind reported resume, and the first unlock completed normally. A single-output reporter independently showed that an external
PrepareForSleep=falselistener driving the same recovery method fixes the preserved-surface case; the corrected branch is now available for an exact retest of that topology.