Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

linux: quit after the last window is closed (#7602)

Dzmitry Malyshau0ab1094f0c97
diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs
index 1776ee00b7e..b5ab1fcf932 100644
--- a/crates/gpui/src/platform/linux/platform.rs
+++ b/crates/gpui/src/platform/linux/platform.rs
@@ -125,11 +125,8 @@ impl Platform for LinuxPlatform {
// window "x" button clicked by user, we gracefully exit
let window = self.state.lock().windows.remove(&ev.window()).unwrap();
window.destroy();
- if self.state.lock().windows.is_empty() {
- if let Some(ref mut fun) = self.callbacks.lock().quit {
- fun();
- }
- }
+ let mut state = self.state.lock();
+ state.quit_requested |= state.windows.is_empty();
}
}
}
@@ -164,6 +161,10 @@ impl Platform for LinuxPlatform {
runnable.run();
}
}
+
+ if let Some(ref mut fun) = self.callbacks.lock().quit {
+ fun();
+ }
}
fn quit(&self) {