fix: app fails to exit on windows/linux when last window is closed

- Set QuitMode::Explicit only on macOS to allow the app to stay alive without windows.
- Use the default QuitMode (CloseAll) on Windows and Linux so the application correctly exits when the main window is closed.
This commit is contained in:
TomZz
2026-06-11 02:15:19 +08:00
parent 5b381045f9
commit cdf4cc3d53
+5
View File
@@ -3581,9 +3581,14 @@ fn main() {
)
.init();
#[cfg(target_os = "macos")]
let app = gpui_platform::application()
.with_assets(Assets)
.with_quit_mode(QuitMode::Explicit);
#[cfg(not(target_os = "macos"))]
let app = gpui_platform::application()
.with_assets(Assets);
app.on_reopen(|cx| {
if cx.windows().is_empty() {
open_main_window(cx);