I'm currently working on understanding building Rust apps using Bevy in WebAssembly. Under normal circumstances, the exit_all_on_closed
variable in the following code allows for the app to close when the window the app is launched in is closed.
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(WindowPlugin {
window: WindowDescriptor {
title: "Extreme".to_string(),
..default()
},
add_primary_window: true,
exit_on_all_closed: true,
close_when_requested: true,
}))
.run()
}
Since I'm launching the app in my browser using a wasm server, I'd assumed that closing either the tab the app launches in or the entire browser would trigger the app exit, but it does not. Is there functionality in Bevy to handle that? Is there another work around?
Attempted: set exit_all_on_closed
to true
, launch app in browser, and close browser. Expected app to exit.
Actual result: Browser window closed but app is still running.