diff --git a/crates/bevy_window/src/lib.rs b/crates/bevy_window/src/lib.rs index a00f851d35b5d..ecac9a4ae25d2 100644 --- a/crates/bevy_window/src/lib.rs +++ b/crates/bevy_window/src/lib.rs @@ -54,7 +54,7 @@ pub struct WindowPlugin { /// create 'headless' processes (processes without windows), which may /// surprise your users. It is recommended to leave this setting as `true`. /// - /// If true, this plugin will add [`exit_on_all_closed`] to [`CoreStage::Update`]. + /// If true, this plugin will add [`exit_on_all_closed`] to [`CoreStage::PostUpdate`]. pub exit_on_all_closed: bool, /// Whether to close windows when they are requested to be closed (i.e. /// when the close button is pressed). diff --git a/examples/app/return_after_run.rs b/examples/app/return_after_run.rs index bc7e2b1f0e3b9..966659688655e 100644 --- a/examples/app/return_after_run.rs +++ b/examples/app/return_after_run.rs @@ -3,33 +3,24 @@ use bevy::{prelude::*, winit::WinitSettings}; fn main() { - println!("Running first App."); + println!("Running Bevy App"); App::new() .insert_resource(WinitSettings { return_from_run: true, ..default() }) - .insert_resource(ClearColor(Color::rgb(0.2, 0.2, 0.8))) - .add_plugins(DefaultPlugins) - .add_system(system1) - .run(); - println!("Running another App."); - App::new() - .insert_resource(WinitSettings { - return_from_run: true, + .add_plugins(DefaultPlugins.set(WindowPlugin { + window: WindowDescriptor { + title: "Close the window to return to the main function".to_owned(), + ..default() + }, ..default() - }) - .insert_resource(ClearColor(Color::rgb(0.2, 0.8, 0.2))) - .add_plugins(DefaultPlugins.build().disable::()) - .add_system(system2) + })) + .add_system(system) .run(); - println!("Done."); -} - -fn system1() { - info!("logging from first app"); + println!("Bevy App has exited. We are back in our main function."); } -fn system2() { - info!("logging from second app"); +fn system() { + info!("Logging from Bevy App"); }