Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
gpui(windows): Reset foreground time budget when hitting the timeout limit (#43886)
Lukas Wirthaa0e19fecaa7
diff --git a/crates/gpui/src/platform/windows/platform.rs b/crates/gpui/src/platform/windows/platform.rsindex e1efaeb8a34..b7ad6029b87 100644--- a/crates/gpui/src/platform/windows/platform.rs+++ b/crates/gpui/src/platform/windows/platform.rs@@ -815,7 +815,7 @@ impl WindowsPlatformInner {fn run_foreground_task(&self) -> Option<isize> {const MAIN_TASK_TIMEOUT: u128 = 10;- let start = std::time::Instant::now();+ let mut start = std::time::Instant::now();loop {loop {if start.elapsed().as_millis() >= MAIN_TASK_TIMEOUT {@@ -842,6 +842,7 @@ impl WindowsPlatformInner {if peek_msg(&mut msg, PM_QS_PAINT) {process_message(&msg);}+ start = std::time::Instant::now();}match self.main_receiver.try_recv() {Err(_) => break,