Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
windows: Fix `Zed` freezing when resuming from sleep (#11589)
张小白9772b7ac33d9
diff --git a/crates/gpui/src/platform/windows/platform.rs b/crates/gpui/src/platform/windows/platform.rsindex efd3695843e..a38e0d18b4e 100644--- a/crates/gpui/src/platform/windows/platform.rs+++ b/crates/gpui/src/platform/windows/platform.rs@@ -813,8 +813,8 @@ unsafe fn show_savefile_dialog(directory: PathBuf) -> Result<IFileSaveDialog> {fn begin_vsync_timer(vsync_event: HANDLE, timer_stop_event: OwnedHandle) {let vsync_fn = select_vsync_fn();- std::thread::spawn(move || {- while vsync_fn(timer_stop_event.to_raw()) {+ std::thread::spawn(move || loop {+ if vsync_fn(timer_stop_event.to_raw()) {if unsafe { SetEvent(vsync_event) }.log_err().is_none() {break;}