diff --git a/shell/lock/LockSurface.qml b/shell/lock/LockSurface.qml index 91c8140..2d9d852 100644 --- a/shell/lock/LockSurface.qml +++ b/shell/lock/LockSurface.qml @@ -13,6 +13,36 @@ WlSessionLockSurface { color: S.Theme.base00 + // 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 visual content so it's below in z-order - widget 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(); + } + } + property real _unlockFade: 1 // Threat level: eased curve so fails 1-2 are subtle, 3+ ramps up. @@ -194,36 +224,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. - // 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(); - } - } - onVisibleChanged: { if (visible) _keyInput.forceActiveFocus();