From b6f2740ff45d32ae7dd3b2995c11f3806c870987 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Fri, 18 Oct 2024 22:19:27 -0700 Subject: [PATCH] lockscreen: Forward keyboard key immediately to password bar Currently, only the second key press gets forwarded to the password bar. Ensure that the first key is also forwarded correctly. --- shell/contents/lockscreen/LockScreen.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shell/contents/lockscreen/LockScreen.qml b/shell/contents/lockscreen/LockScreen.qml index aed6a40c..3cc21b17 100644 --- a/shell/contents/lockscreen/LockScreen.qml +++ b/shell/contents/lockscreen/LockScreen.qml @@ -35,11 +35,13 @@ Item { } // Listen for keyboard events, and focus on input area - Keys.onPressed: { + Keys.onPressed: (event) => { if (flickableLoader.item) { root.lockScreenState.isKeyboardMode = true; flickableLoader.item.goToOpenPosition(); passwordBar.textField.forceActiveFocus(); + + passwordBar.keyPress(event.text); } } @@ -176,7 +178,7 @@ Item { // Clear entered password after closing keypad onOpenFactorChanged: { - if (flickable.openFactor < 0.1) { + if (flickable.openFactor < 0.1 && !flickable.movingUp) { root.passwordBar.clear(); } }