Avoid idle clock and screenshot polling

Update visible shell clocks at their displayed time boundaries and receive recorder state through events, with elapsed updates only while recording. Arm screenshot expiry at the earliest pending deadline and cancel abandoned requests when their IPC client disconnects.

Cache desktop clock formats across shell updates. Transfer owned screenshot readback pixels to the encoder and borrow the canvas for PNG encoding; both paths previously copied a full image. Close the recorder's stdout reader before waiting for its child when a status line is rejected.

Validation: 910 Rust tests passed in the release workspace suite, with 44 ignored. The six screenshot-script tests passed. A private nested release test passed with a visible desktop clock, notification and modal animations, and three real PNG captures. The recorder shutdown and readback ownership regressions failed before their fixes and pass afterwards.

The isolated clock settings check dropped from 30,000 allocations to zero over 10,000 rebuilds. Borrowing the PNG canvas removed 33,177,600 allocated bytes for a 3840x2160 capture while producing identical PNG bytes.

Direct DRM and laptop power checks remain pending.
This commit is contained in:
Samuel Onoja authored and GitHub committed 2026-10-04 13:01:52 +01:00
1 parent 49e54f9a63
commit 90e5c3543d
7 files changed
+1562 -161

No files matched your search

+3
View File
@@ -767,6 +767,9 @@ impl Ferese {
};
state.config_worker = Some(crate::reload::Worker::new(event_loop)?);
let screenshot = crate::ipc::init(event_loop)?;
state
.screenshot
.set_deadline_observer(move |deadline| screenshot.deadline_timer.update(deadline));
state.screenshot_parts = Some(screenshot.parts);
state.screenshot_worker = Some(screenshot.worker);
state._ipc_socket = Some(screenshot._guard);