mirror of
https://github.com/rust-kotlin/ashell.git
synced 2026-09-22 16:00:59 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user