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.
This commit is contained in:
Devin Lin 2024-07-07 21:54:14 -04:00
parent 14cf029ece
commit 4c552b84be

View file

@ -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) {