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 {
|
||||
id: _keyInput
|
||||
anchors.fill: parent
|
||||
focus: true
|
||||
Keys.onPressed: event => {
|
||||
if (!root._unlocking)
|
||||
root.auth.handleKey(event);
|
||||
}
|
||||
onActiveFocusChanged: {
|
||||
if (!activeFocus)
|
||||
forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible)
|
||||
_keyInput.forceActiveFocus();
|
||||
}
|
||||
|
||||
// Unlock animation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue