Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing primary window leaves secondary window intact #72

Open
bayou-brogrammer opened this issue Apr 2, 2023 · 0 comments
Open

Closing primary window leaves secondary window intact #72

bayou-brogrammer opened this issue Apr 2, 2023 · 0 comments

Comments

@bayou-brogrammer
Copy link

If i use EditorPlugin::new().on_second_monitor_fullscreen() or EditorPlugin::new().in_new_window() then closing the primary window does not cause the app to shut down.

I don't know if this was intentional or not, but i figured I would mention it just in case. For my workaround, i just added a system to close bevy if the primary window ceases to exist

fn exit_on_primary_window_close(
    mut app_exit_events: EventWriter<AppExit>,
    primary_windows: Query<&Window, With<PrimaryWindow>>,
) {
    if primary_windows.is_empty() {
        log::info!("Primary window closed, exiting");
        app_exit_events.send(AppExit);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant