graphic design tool
git clone https://git.lucas.co/cce-designer.git
idle_poll_interval: tick polls a channel the runner cannot see
cce-ui@d5b22a5 sleeps between ticks while idle; this app drains its own
std channels in tick, so it bounds that sleep rather than waiting for an
unrelated event.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
src/application.rs | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/application.rs b/src/application.rs
index 8c277a1..5f504d8 100644
--- a/src/application.rs
+++ b/src/application.rs
@@ -212,6 +212,17 @@ impl Application for State {
}
}
+ /// `poll_shared_project` watches the project file's mtime for a detached
+ /// pane's edits — nothing the runner can be woken by — so while a pane is
+ /// detached the loop may not sleep past this between ticks.
+ fn idle_poll_interval(&self) -> Option<std::time::Duration> {
+ let syncing = self.is_detached_network
+ || self.detached_circular_network
+ || self.detached_pane.is_some()
+ || self.detached_panes.iter().any(|d| *d);
+ syncing.then(|| std::time::Duration::from_millis(250))
+ }
+
fn tick(&mut self, dt: f32, needs_rebuild: &mut bool) {
if self.tick_frame(dt) {
*needs_rebuild = true;