LockScreen: add slight delay for pam to initilize before suspend

This commit is contained in:
Lysec
2026-01-24 14:29:28 +01:00
parent a4c73f15c1
commit f05bb82428
2 changed files with 41 additions and 5 deletions
+19
View File
@@ -20,7 +20,26 @@ Loader {
// Track if the visualizer should be shown (lockscreen active + media playing + non-compact mode)
readonly property bool needsCava: root.active && !Settings.data.general.compactLockScreen && Settings.data.audio.visualizerType !== "" && Settings.data.audio.visualizerType !== "none"
// Readiness for suspend - wait a bit to ensure PAM (fprintd) has time to initialize
property bool readyForSuspend: false
Timer {
id: suspendReadinessTimer
interval: 800 // 800ms should be enough for PAM to start
repeat: false
running: root.active
onTriggered: {
root.readyForSuspend = true;
Logger.i("LockScreen", "Ready for suspend (PAM initialization time elapsed)");
}
}
onActiveChanged: {
if (root.active) {
root.readyForSuspend = false;
suspendReadinessTimer.restart();
}
if (root.active && root.needsCava) {
CavaService.registerComponent("lockscreen");
} else {