From d85b65c6d9fb1e6289f5914d015dc0f381c1a3b3 Mon Sep 17 00:00:00 2001 From: Damocles Date: Mon, 27 Apr 2026 18:04:41 +0200 Subject: [PATCH] fix lock screen tap handlers blocked by TextInput z-order --- shell/lock/LockSurface.qml | 60 +++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) 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();