Don't fire a pending idle action whose timeout was set to 0

The timers' intervals are bound to the configured delays, so setting the lock or screensaver to 0 while the screensaver is up turns a pending timer's interval to 0 and it fires at once. Check the action is still enabled when its timer fires.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
OmarchybotandClaude Opus 5.5 committed 2026-10-01 11:29:30 +02:00
1 parent 14921a956e
commit 377b15be4b
2 files changed
+10 -2

No files matched your search

+2 -2
View File
@@ -267,14 +267,14 @@ Item {
id: screensaverTimer
interval: root.screensaverDelaySeconds * 1000
repeat: false
onTriggered: root.launchScreensaver()
onTriggered: if (root.screensaverEnabled) root.launchScreensaver()
}
Timer {
id: lockTimer
interval: root.lockDelaySeconds * 1000
repeat: false
onTriggered: if (root.idleEnabled && root.idledThisCycle) root.lockSystem("lock-timeout")
onTriggered: if (root.idleEnabled && root.idledThisCycle && root.lockEnabled) root.lockSystem("lock-timeout")
}
Timer {