Repository navigation
Cap idle timeouts at the longest interval a timer can hold - #14581
omarchybot wants to merge 1 commit into
Conversation
Qt timer intervals are int32 milliseconds, so an idle.lock or idle.screensaver past 2147483 seconds (about 24.8 days) wrapped negative when the service multiplied it by 1000. Qt rejected it with a warning every millisecond of the idle cycle, and the shell's instance log filled $XDG_RUNTIME_DIR until uwsm could no longer launch apps. Capping in secondsFromConfig keeps both timers and the IdleMonitor timeout in range for every combination of the two settings; 0 still disables. Fixes #7506 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
|
Heads-up: this is the same cap as #13921 (@Coding-Sparrow), which is open and mergeable: |
|
Closing this as a duplicate of #7578, which was opened earlier against #13921 and #11136 are later takes on the same bug and are left to the maintainer. #11136 clamps the intervals in I compared the two diffs by reading them. Nothing was run for this decision. Codex Medium classified this one separately as a bug, and |
Qt timer intervals are int32 milliseconds. The idle service turns
idle.lockandidle.screensaverinto seconds with no upper bound and multiplies the delay by 1000 when it arms a timer, so any timeout past 2147483 seconds (about 24.8 days) wraps negative. The natural "never lock" value,999999999, is well past that. Qt rejects the negative interval withQBasicTimer::start: negative intervals aren't allowedevery millisecond of the idle cycle, and the shell's instance log grows until it fills$XDG_RUNTIME_DIR. After that, uwsm's app daemon fails with ENOSPC and no application launches.This caps the value in
secondsFromConfig, where both settings enter the service. The first-idle timeout and both delays are derived from the capped values, so the screensaver timer, the lock timer and the IdleMonitor timeout all stay in range for every combination of the two settings. A value above the cap now means about 24.8 days.0still disables the action, which is the setting for never locking.Reproduced on a worker running the real shell with
screensaver: 3, lock: 999999999. Onquattro, 25 seconds of idle logged about 18,400 warnings (2.2 MB). With this change it logged none, and the lock timer was armed at 2147483 seconds. Reverting it brought the warnings back. Codex Medium reviewed the fix over two rounds. It asked for the boundary and pairing cases now inidle-test.sh, and found nothing open in the final diff.Fixes #7506