mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-18 09:14:01 -04:00
lock: hold the fingerprint scan from a sleep request until PrepareForSleep
fixes #3774
This commit is contained in:
@@ -335,7 +335,7 @@ Scope {
|
||||
readonly property int verifyStartSlackMs: 10000
|
||||
readonly property bool retrying: errorRetry.running
|
||||
readonly property int retryInterval: errorRetry.interval
|
||||
readonly property bool allowed: available && SettingsData.enableFprint && root.lockSecured && !root.fprintSuppressedByPrimaryPam && !root.unlockInProgress && !root.u2fPending && !SessionService.preparingForSleep && !IdleService.monitorsOff && tries < SettingsData.maxFprintTries
|
||||
readonly property bool allowed: available && SettingsData.enableFprint && root.lockSecured && !root.fprintSuppressedByPrimaryPam && !root.unlockInProgress && !root.u2fPending && !SessionService.preparingForSleep && !SessionService.sleepRequested && !IdleService.monitorsOff && tries < SettingsData.maxFprintTries
|
||||
readonly property string status: {
|
||||
if (!available || !SettingsData.enableFprint || !root.lockSecured || root.fprintSuppressedByPrimaryPam)
|
||||
return "disabled";
|
||||
|
||||
@@ -35,6 +35,7 @@ Singleton {
|
||||
property bool idleHint: false
|
||||
property bool lockedHint: false
|
||||
property bool preparingForSleep: false
|
||||
property bool sleepRequested: false
|
||||
property string sessionType: ""
|
||||
property string userName: ""
|
||||
property string seat: ""
|
||||
@@ -85,6 +86,21 @@ Singleton {
|
||||
onTriggered: root.flushPendingSleep()
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: sleepRequestTimeout
|
||||
// A refused sleep or a command that skips logind never sends PrepareForSleep.
|
||||
interval: 10000
|
||||
repeat: false
|
||||
onTriggered: root.sleepRequested = false
|
||||
}
|
||||
|
||||
onPreparingForSleepChanged: {
|
||||
if (!preparingForSleep)
|
||||
return;
|
||||
sleepRequestTimeout.stop();
|
||||
sleepRequested = false;
|
||||
}
|
||||
|
||||
Process {
|
||||
id: detectEnvironmentProcess
|
||||
running: false
|
||||
@@ -506,6 +522,8 @@ printf 'uwsm=%s\nelogind=%s\nloginctl=%s\nsystemctl=%s\nusermgr=%s\nhibernate=%s
|
||||
|
||||
function runSleepAction(run) {
|
||||
cancelPendingSleep();
|
||||
sleepRequested = true;
|
||||
sleepRequestTimeout.restart();
|
||||
if (!SleepLock.shouldWaitForLock(SettingsData.lockBeforeSuspend, IdleService.isSessionLockSecure)) {
|
||||
run();
|
||||
return;
|
||||
|
||||
@@ -3,6 +3,7 @@ import QtQuick
|
||||
|
||||
QtObject {
|
||||
property bool preparingForSleep: false
|
||||
property bool sleepRequested: false
|
||||
signal sessionResumed
|
||||
signal lidOpened
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user