Repository navigation
Conversation
forcePasswordFocus() was only triggered by inputEnabled toggling true, which fires before the compositor grants the session lock surface exclusive keyboard focus. Also force focus once WlSessionLock reports secure=true, when focus is actually available.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a deferred focus action during session lock activation to ensure the password input is focused after starting fingerprint handling.
Changes:
- Schedule
lockView.forcePasswordFocusviaQt.callLater()afterroot.startFingerprint().
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
shell/plugins/lock/Service.qml:242
- Because
Qt.callLater()defers execution,lockViewmay no longer be in a valid state by the time this runs (e.g., lock view gets torn down quickly or replaced). Consider guarding the call (e.g., ensurelockViewis still the active/visible lock view before focusing), or using a cancelableTimertied to the view’s lifecycle so you don’t attempt to focus a stale object.
Qt.callLater(function() { lockView.forcePasswordFocus() })
|
This fix hooks Reproduction — ThinkPad docked to an external display, lid closed (Omarchy 4.0.0, Hyprland 0.56.2, quickshell 0.3.0.r20.g28771c7, Qt 6.11.1):
Instrumented during the dead window: keypresses were arriving at evdev, Hyprland still listed 7–9 keyboards including the built-in one, and Controlled A/B on the same machine, one variable changed:
Keeping the output set constant avoids the surface rebuild entirely, and the field keeps focus. This also lines up with the Copilot review note about Filed by Claude Opus 5 via Claude Code. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (3)
shell/plugins/lock/Service.qml:242
Qt.callLaterdefers execution to a future event loop tick; iflockViewis destroyed/replaced before this runs, callinglockView.retryPasswordFocus()can throw a runtime error. Consider guarding inside the callback (e.g., checklockViewis still valid and the function exists) before invoking.
Qt.callLater(function() { lockView.retryPasswordFocus() })
shell/plugins/lock/LockView.qml:61
retryPasswordFocus()restarts the repeating timer even ifforcePasswordFocus()immediately succeeds. This causes at least one extra timer tick per call. Consider checkingpasswordInput.activeFocusafterforcePasswordFocus()(or before restarting the timer) and only starting the retry timer when focus still wasn’t obtained.
function retryPasswordFocus() {
if (!inputEnabled || authenticatingPassword) return
forcePasswordFocus()
focusRetryTimer.attemptsLeft = 20
focusRetryTimer.restart()
}
shell/plugins/lock/LockView.qml:70
- The retry behavior is controlled by magic numbers (
interval: 150andattemptsLeft = 20). Making these namedproperty intvalues (e.g., max attempts, retry interval) and adding a brief comment on why these values were chosen will make future tuning safer and clearer.
interval: 150
repeat: true
property int attemptsLeft: 0
This reverts commit 1316280.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
shell/plugins/lock/Service.qml:242
- Because this runs asynchronously on the next event loop tick, it can execute after
lockViewhas been replaced/unloaded, which would throw a runtime error when callingforcePasswordFocus(). Add a guard inside thecallLatercallback (e.g., verifylockViewis still valid and thatforcePasswordFocusexists) before invoking it.
Qt.callLater(function() { lockView.forcePasswordFocus() })
shell/plugins/lock/Service.qml:241
- This deferred focus change is subtle and can be hard to reason about later (especially around focus-stealing behavior). Add a brief inline comment explaining why
Qt.callLateris required here (e.g., focus must occur after the lock view is shown or after fingerprint start triggers UI changes).
Qt.callLater(function() { lockView.forcePasswordFocus() })
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (2)
shell/plugins/lock/LockView.qml:76
onSecureChangedcan callforcePasswordFocuseven wheninputEnabledis false, which may steal focus / potentially trigger unintended input behaviors while input is disabled. Consider gating the focus call by bothsecureandinputEnabled(or otherwise ensuring focus is only requested when input is allowed).
onInputEnabledChanged: {
if (inputEnabled) Qt.callLater(forcePasswordFocus)
}
onSecureChanged: {
if (secure) Qt.callLater(forcePasswordFocus)
}
shell/plugins/lock/LockView.qml:80
- The password-focus decision is now split across
onInputEnabledChanged,onSecureChanged, andComponent.onCompleted. This duplication risks future divergence (e.g., different gating conditions). Consider extracting a small helper (e.g.,maybeForcePasswordFocus()) and calling it from all three places so the focus rules stay consistent.
onInputEnabledChanged: {
if (inputEnabled) Qt.callLater(forcePasswordFocus)
}
onSecureChanged: {
if (secure) Qt.callLater(forcePasswordFocus)
}
Component.onCompleted: {
syncPasswordText()
if (inputEnabled) Qt.callLater(forcePasswordFocus)
|
hey, this is already covered in #12894 (lock keyboard focus after lid-open / resume). mind closing this as a duplicate? |
|
Reviewed at The initial-lock race did not reproduce. On A case that does reproduce is not covered. With a second output focused, locking and then removing that output while locked leaves keystrokes dead, on Competing fixes. #7592 and #7471 (by @RovshanMuradov and @notTanveer) retry focus with a timer bound to Also: this branch no longer merges cleanly with Reviewed by Claude Opus 5.5, with a second opinion from Codex at medium effort. Codex came to the same Qt-focus reading on its own terms, and put #7471 ahead of #7592 because it also wakes a blanked screen from the keyboard; it could not fetch the pull requests from its sandbox, so that ranking rests on partial reading, and its independence is not guaranteed since it can read this session's transcript. Waiting on the maintainer. |
I noticed that sometimes on the password screen when I type my input does not go into the password field.
According to Claude: