fix lock screen widget interaction by moving TextInput below content in z-order
This commit is contained in:
parent
a8d8da7145
commit
8f66d67029
1 changed files with 30 additions and 28 deletions
|
|
@ -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
|
// Center content
|
||||||
Item {
|
Item {
|
||||||
id: content
|
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: {
|
onVisibleChanged: {
|
||||||
if (visible)
|
if (visible)
|
||||||
_keyInput.forceActiveFocus();
|
_keyInput.forceActiveFocus();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue