quit the application when main window is closed on macOS

This commit is contained in:
Fabrice Bellamy
2026-02-21 22:58:51 +01:00
parent 997b105666
commit 5f161c8be4
+7
View File
@@ -82,5 +82,12 @@ fn main() {
Ok::<_, anyhow::Error>(())
})
.detach();
// Quit the application when the window is closed (specifically needed for macOS)
#[cfg(target_os = "macos")]
{
cx.on_window_closed(|cx| cx.quit())
.detach();
}
});
}