From f802039757d5da01a2b7cb7d1b15c692f137d91f Mon Sep 17 00:00:00 2001 From: Tommaso Negri Date: Wed, 14 Oct 2026 21:58:57 +0200 Subject: add tasks --- tasks/20261014-191606/TASK.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tasks/20261014-191606/TASK.md (limited to 'tasks/20261014-191606/TASK.md') diff --git a/tasks/20261014-191606/TASK.md b/tasks/20261014-191606/TASK.md new file mode 100644 index 0000000..5c286a9 --- /dev/null +++ b/tasks/20261014-191606/TASK.md @@ -0,0 +1,17 @@ +# Run daemon event loops so registered callbacks are delivered + +- STATUS: OPEN +- PRIORITY: 70 +- TAGS: review,bug,deamons + +Files: daemons/batteryd.c, brightnessd.c, devicesd.c, networkd.c, focusd.c, nowplayingd.c; corresponding DocC daemon articles. + +Problem: Run-loop sources/observers are registered, but the main thread then waits in pause() instead of running its CFRunLoop. Adding a source does not process its events. Treat each daemon's delivery mechanism explicitly; do not assume the CoreAudio or socket daemons need the same fix. + +Approach: Use a small run-loop-based wait, with a shutdown strategy that responds to SIGINT/SIGTERM. For example, bounded CFRunLoopRunInMode iterations can check a volatile sig_atomic_t flag; account for absent sources and avoid a busy loop. Validate registration results and fail clearly if setup cannot work. Preserve the editable bar.touch. convention. + +Completion checks: Build with the compile commands in each source header. After setting an actual block name, trigger battery/network/device events and the relevant distributed notifications; observe posts using notifyutil or the bar. Confirm clean prompt shutdown and no idle spin. Record which hardware events were tested and which remain unverified. + +Reference: https://developer.apple.com/documentation/corefoundation/cfrunloopruninmode(_:_:_:). + +Design constraint: Follow README.md: keep source-based configuration, no dependencies or plugin framework, and use the smallest readable change that makes the existing behavior reliable. This is a suggestion for individual review, not a deadline. Findings were recorded on 2026-10-14; re-check the current code before implementing. -- cgit v1.2.3