Revert "LockScreen: add slight delay for pam to initilize before suspend"

This reverts commit f05bb82428.
This commit is contained in:
Lysec
2026-01-24 15:32:46 +01:00
parent e9c7ed7570
commit 8d905eafa2
2 changed files with 5 additions and 41 deletions
-19
View File
@@ -20,26 +20,7 @@ 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 {
+5 -22
View File
@@ -478,29 +478,12 @@ Singleton {
// Check if lock screen is now active
if (PanelService && PanelService.lockScreen && PanelService.lockScreen.active) {
// Verify the lock screen component is loaded AND ready
// Verify the lock screen component is loaded
if (PanelService.lockScreen.item) {
// Check if the lock screen says it's ready for suspend (PAM initialized)
// If property doesn't exist (older version), assume ready
var isReady = true;
if (PanelService.lockScreen.item.readyForSuspend !== undefined) {
isReady = PanelService.lockScreen.item.readyForSuspend;
}
if (isReady) {
Logger.i("Compositor", "Lock screen active and ready, suspending");
stop();
lockAndSuspendCheckCount = 0;
suspend();
} else {
// Lock screen active but not ready yet (waiting for timer)
if (lockAndSuspendCheckCount > 25) { // 2.5 seconds max wait total
Logger.w("Compositor", "Lock screen timed out waiting for readiness, suspending anyway");
stop();
lockAndSuspendCheckCount = 0;
suspend();
}
}
Logger.i("Compositor", "Lock screen confirmed active, suspending");
stop();
lockAndSuspendCheckCount = 0;
suspend();
} else {
// Lock screen is active but component not loaded yet, wait a bit more
if (lockAndSuspendCheckCount > 20) {