lock: aggressively reclaim keyboard focus on lock surface
This commit is contained in:
parent
032035b7f1
commit
9f0043cd23
1 changed files with 13 additions and 1 deletions
|
|
@ -139,14 +139,26 @@ WlSessionLockSurface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard input - focus lives on an Item since WlSessionLockSurface is a window
|
// Keyboard input - focus lives on an Item since WlSessionLockSurface is a window.
|
||||||
|
// Aggressively reclaim focus: Component.onCompleted may fire before the surface
|
||||||
|
// is configured, and other items can steal activeFocus during layout.
|
||||||
Item {
|
Item {
|
||||||
|
id: _keyInput
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
focus: true
|
focus: true
|
||||||
Keys.onPressed: event => {
|
Keys.onPressed: event => {
|
||||||
if (!root._unlocking)
|
if (!root._unlocking)
|
||||||
root.auth.handleKey(event);
|
root.auth.handleKey(event);
|
||||||
}
|
}
|
||||||
|
onActiveFocusChanged: {
|
||||||
|
if (!activeFocus)
|
||||||
|
forceActiveFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (visible)
|
||||||
|
_keyInput.forceActiveFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unlock animation
|
// Unlock animation
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue