fix lock screen tap handlers blocked by TextInput z-order

This commit is contained in:
Damocles 2026-04-27 18:04:41 +02:00
parent 1d92463819
commit d85b65c6d9

View file

@ -13,6 +13,36 @@ WlSessionLockSurface {
color: S.Theme.base00 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 property real _unlockFade: 1
// Threat level: eased curve so fails 1-2 are subtle, 3+ ramps up. // 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: { onVisibleChanged: {
if (visible) if (visible)
_keyInput.forceActiveFocus(); _keyInput.forceActiveFocus();