mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
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:
parent
14cf029ece
commit
4c552b84be
1 changed files with 11 additions and 1 deletions
|
|
@ -103,13 +103,23 @@ Item {
|
||||||
// Distance to swipe to fully open keypad
|
// Distance to swipe to fully open keypad
|
||||||
keypadHeight: Kirigami.Units.gridUnit * 20
|
keypadHeight: Kirigami.Units.gridUnit * 20
|
||||||
|
|
||||||
// Unlock lockscreen if it's already unlocked
|
// Unlock lockscreen if it's already unlocked and keypad is opened
|
||||||
onOpened: {
|
onOpened: {
|
||||||
if (root.lockScreenState.canBeUnlocked) {
|
if (root.lockScreenState.canBeUnlocked) {
|
||||||
Qt.quit();
|
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
|
// Clear entered password after closing keypad
|
||||||
onOpenFactorChanged: {
|
onOpenFactorChanged: {
|
||||||
if (flickable.openFactor < 0.1) {
|
if (flickable.openFactor < 0.1) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue