summaryrefslogtreecommitdiff
path: root/src/app/runtime.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-04-21 17:37:41 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-04-21 17:37:41 +0300
commitb1c9833b828d12e7e0196c5607ae63372998e25a (patch)
treec8b1ff84cea1cf4367c5163e4721d028cf7856cf /src/app/runtime.rs
parent8a4571198d013451743d1238f80a6bd69d67b32d (diff)
fix: stop headless idle spin and skip unnecessary macos probes
Diffstat (limited to 'src/app/runtime.rs')
-rw-r--r--src/app/runtime.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/app/runtime.rs b/src/app/runtime.rs
index d82f6440..b6ad806b 100644
--- a/src/app/runtime.rs
+++ b/src/app/runtime.rs
@@ -227,6 +227,23 @@ impl App {
}
pub(crate) fn next_loop_deadline(&self, now: Instant, needs_render: bool) -> Option<Instant> {
+ self.next_loop_deadline_with_resize_poll(now, needs_render, true)
+ }
+
+ pub(crate) fn next_headless_loop_deadline(
+ &self,
+ now: Instant,
+ needs_render: bool,
+ ) -> Option<Instant> {
+ self.next_loop_deadline_with_resize_poll(now, needs_render, false)
+ }
+
+ fn next_loop_deadline_with_resize_poll(
+ &self,
+ now: Instant,
+ needs_render: bool,
+ include_resize_poll: bool,
+ ) -> Option<Instant> {
let render_deadline = if needs_render {
self.last_render_at
.map(|last_render_at| last_render_at + MIN_RENDER_INTERVAL)
@@ -236,7 +253,7 @@ impl App {
};
[
- Some(self.next_resize_poll),
+ include_resize_poll.then_some(self.next_resize_poll),
self.config_diagnostic_deadline,
self.toast_deadline,
self.next_animation_tick,