Repository navigation
Conversation
|
| 'a finished password check focuses the field again' | ||
| ) | ||
|
|
||
| assert( | ||
| /enabled:\s*root\.inputEnabled && !root\.authenticatingPassword/.test(view), | ||
| 'the field is still disabled for the duration of the password check' | ||
| ) |
There was a problem hiding this comment.
These assertions check that the handler and enabled binding appear in the source, but not whether the field regains activeFocus after a failed password check. If forcePasswordFocus() stops focusing the field, the test still passes while the bug returns. A test of the QML state transition could verify the focus result without running a live PAM failure.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Stock LockView only schedules one forceActiveFocus() from Component.onCompleted and onInputEnabledChanged. That lands while the session-lock surface is still inactive, and focus is dropped again when the idle screensaver exits after lock-requested or when a failed PAM check disables and re-enables the field. Replace the one-shot handlers with a short retry Timer that re-arms whenever the password field should be interactive but does not hold activeFocus. Fixes the screensaver-to-lock path in omacom#6858 and the failed password path previously covered here.
8820b7f to
d31566c
Compare
|
Thanks @argrig666. The bug is real, and your trace of the failed-password path on #6858 is clear. But this is one of five open pull requests for the same lost-focus bug, and the retry timer here is already in an older one. So I've left this one with the maintainer and not recommended it. What was checked. I read the diff against Why #7471 rather than this one. When competing fixes are this similar, the oldest one is preferred. A newer one takes its place only if it fixes something the older one misses. #7471 (opened 2026-08-19) adds the same repeating 100ms timer, with the same Second opinion. Codex at medium effort was asked which pull request should win, without being told my answer. It reached the same choice, #7471, for the same reasons. Its agreement is not independent, because it can read this session's transcript. It added two points of its own: #7471 also wakes a blanked lock from the keyboard, which this one does not; and the QML fixture in #12435 tests real focus recovery, not just the source text, so it's worth adapting to whichever fix lands. What happens next. Choosing between the competing fixes is the maintainer's decision, so this pull request is waiting on them. You don't need to change anything here. |
|
Closing as duplicate effort of #7471 per omarchybot's comparison. |
Summary
Stock
LockViewonly schedules oneforceActiveFocus()fromComponent.onCompletedandonInputEnabledChangedviaQt.callLater. That request lands while the session-lock surface is still inactive, and focus is dropped again when:lock-requestedactiveFocusTyping then does nothing until the password field is clicked.
Replace the one-shot handlers with a short retry
Timerthat stays armed while the field should be interactive but does not holdactiveFocus. Therunningbinding re-arms on every later focus loss.Fixes #6858 (screensaver → lock and cold-lock focus race; also covers the failed-password path).
Related: #7467, #12587, #9180, #14067.
Test plan
./test/shell.d/lock-password-refocus-test.sh./test/shell.d/lock-password-overflow-test.shgit diff --checkomarchy.lock, apply the Timer, restart shell; after idle screensaver → lock, typing works without a mouse click (Omarchy 4.0.4-1, Dell G15 5510, single eDP)