End a running idle cycle when both timeouts are set to 0
With both at 0 the monitor is disabled and handleIdleChanged returns early, so a cycle already running when shell.json changed never cancels: omarchy-system-wake never runs, and if the screensaver never opened a window nothing else ends it. Cancel it the way turning on stay-awake does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
This commit is contained in:
1 parent
3839d0b4e0
commit
3cebdc3412
2 files changed
+7
No files matched your search
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user