diff --git a/shell/lock/LockSurface.qml b/shell/lock/LockSurface.qml index f59a5cd..8cfa1cb 100644 --- a/shell/lock/LockSurface.qml +++ b/shell/lock/LockSurface.qml @@ -60,6 +60,36 @@ WlSessionLockSurface { } } + // Keyboard input via TextInput - engages Qt's full input pipeline including + // text-input protocol, which is more reliable than Keys on a plain Item in + // layer-shell/lock surfaces where raw wl_keyboard delivery can be flaky. + // Declared before content so it's below in z-order - content TapHandlers + // receive mouse events, while keyboard activeFocus is independent of stacking. + TextInput { + id: _keyInput + anchors.fill: parent + focus: true + color: "transparent" + selectionColor: "transparent" + selectedTextColor: "transparent" + cursorVisible: false + enabled: !root._unlocking && root.auth.state !== "max" && root.auth.state !== "busy" + + onTextChanged: if (root.auth) + root.auth.buffer = text + + Keys.onReturnPressed: root.auth.submit() + Keys.onEnterPressed: root.auth.submit() + Keys.onEscapePressed: { + text = ""; + } + + onActiveFocusChanged: { + if (!activeFocus) + forceActiveFocus(); + } + } + // Center content Item { id: content @@ -224,34 +254,6 @@ WlSessionLockSurface { } } - // Keyboard input via TextInput - engages Qt's full input pipeline including - // text-input protocol, which is more reliable than Keys on a plain Item in - // layer-shell/lock surfaces where raw wl_keyboard delivery can be flaky. - TextInput { - id: _keyInput - anchors.fill: parent - focus: true - color: "transparent" - selectionColor: "transparent" - selectedTextColor: "transparent" - cursorVisible: false - enabled: !root._unlocking && root.auth.state !== "max" && root.auth.state !== "busy" - - onTextChanged: if (root.auth) - root.auth.buffer = text - - Keys.onReturnPressed: root.auth.submit() - Keys.onEnterPressed: root.auth.submit() - Keys.onEscapePressed: { - text = ""; - } - - onActiveFocusChanged: { - if (!activeFocus) - forceActiveFocus(); - } - } - onVisibleChanged: { if (visible) _keyInput.forceActiveFocus();