From 4c552b84bef66c7ec892c63efaa361017fd4be21 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Sun, 7 Jul 2024 21:54:14 -0400 Subject: [PATCH] lockscreen: Automatically unlock if keypad is open and screen locker says it's unlocked Sometimes from suspend, the screen locker only tells us it can be unlocked (and not direct pin entry success), which requires the user to reopen the keypad if it's already open to unlock. --- shell/contents/lockscreen/LockScreen.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/shell/contents/lockscreen/LockScreen.qml b/shell/contents/lockscreen/LockScreen.qml index fc36c6a5..66300249 100644 --- a/shell/contents/lockscreen/LockScreen.qml +++ b/shell/contents/lockscreen/LockScreen.qml @@ -103,13 +103,23 @@ Item { // Distance to swipe to fully open keypad keypadHeight: Kirigami.Units.gridUnit * 20 - // Unlock lockscreen if it's already unlocked + // Unlock lockscreen if it's already unlocked and keypad is opened onOpened: { if (root.lockScreenState.canBeUnlocked) { Qt.quit(); } } + // Unlock lockscreen if it's already unlocked and keypad is open + Connections { + target: root.lockScreenState + function onCanBeUnlockedChanged() { + if (root.lockScreenState.canBeUnlocked && flickable.openFactor > 0.8) { + Qt.quit(); + } + } + } + // Clear entered password after closing keypad onOpenFactorChanged: { if (flickable.openFactor < 0.1) {