Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions shell/plugins/services/idle/Service.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Item {
readonly property int firstIdleTimeoutSeconds: Math.min(screensaverTimeoutSeconds, lockTimeoutSeconds)
readonly property int screensaverDelaySeconds: Math.max(0, screensaverTimeoutSeconds - firstIdleTimeoutSeconds)
readonly property int lockDelaySeconds: Math.max(0, lockTimeoutSeconds - firstIdleTimeoutSeconds)
// Timer.interval is a 32-bit int; clamp so a large timeout cannot wrap negative.
readonly property int maxTimerIntervalMs: 2147483647
readonly property bool idleEnabled: stayAwakeStateLoaded && !stayAwake
readonly property string screensaverClass: "org.omarchy.screensaver"

Expand Down Expand Up @@ -258,14 +260,14 @@ Item {

Timer {
id: screensaverTimer
interval: root.screensaverDelaySeconds * 1000
interval: Math.min(root.screensaverDelaySeconds * 1000, root.maxTimerIntervalMs)
repeat: false
onTriggered: root.launchScreensaver()
}

Timer {
id: lockTimer
interval: root.lockDelaySeconds * 1000
interval: Math.min(root.lockDelaySeconds * 1000, root.maxTimerIntervalMs)
repeat: false
onTriggered: if (root.idleEnabled && root.idledThisCycle) root.lockSystem("lock-timeout")
}
Expand Down