diff --git a/shell/plugins/services/idle/Service.qml b/shell/plugins/services/idle/Service.qml index 860a3b23..8fb45a6c 100644 --- a/shell/plugins/services/idle/Service.qml +++ b/shell/plugins/services/idle/Service.qml @@ -263,6 +263,9 @@ Item { return applyStayAwake(!value, true, "ipc") } + // With both timeouts at 0 the monitor stops reporting, so nothing else would end a running cycle. + onIdleTimersEnabledChanged: if (!idleTimersEnabled) cancelIdleCycle("idle-timers-disabled") + IdleMonitor { id: idleMonitor enabled: root.idleEnabled && root.idleTimersEnabled diff --git a/test/shell.d/idle-test.sh b/test/shell.d/idle-test.sh index a5057a26..450c8d5a 100644 --- a/test/shell.d/idle-test.sh +++ b/test/shell.d/idle-test.sh @@ -51,6 +51,10 @@ assert( !/interval: root\.screensaverDelaySeconds/.test(serviceSource), 'idle keeps a pending screensaver on its deadline when shell.json changes mid-cycle' ) +assert( + /onIdleTimersEnabledChanged: if \(!idleTimersEnabled\) cancelIdleCycle\(/.test(serviceSource), + 'idle ends a running cycle when both timeouts are set to 0' +) assertDeepEqual(idle.eventParts({ data: 'a,b,c' }, 2), ['a', 'b', 'c'], 'idle parses raw event data') assertDeepEqual(