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

WindowDescriptor has no effect if resource is inserted after .add_plugins(DefaultPlugins) is called during app construction #4386

Closed
colepoirier opened this issue Apr 1, 2022 · 4 comments
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior

Comments

@colepoirier
Copy link
Contributor

Bevy version

main as of date of filing (648544f)

Operating system & version

Linux Mint 20.3, X11

What you did

Inserted WindowDescriptor resource after calling .add_plugins(DefaultPlugins).

What you expected to happen

WindowDescriptor to take effect regardless of order of method calls during app construction.

What actually happened

App construction ordering where WindowDescriptor works like you would expect:

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .insert_resource(WindowDescriptor {
            title: "Test Title".to_string(),
            width: 1920.0,
            height: 1080.0,
            ..Default::default()
        })
        .run();
}

App construction ordering where WindowDescriptor does not work like you would expect:

use bevy::prelude::*;

fn main() {
    App::new()
        .insert_resource(WindowDescriptor {
            title: "Test Title".to_string(),
            width: 1920.0,
            height: 1080.0,
            ..Default::default()
        })
        .add_plugins(DefaultPlugins)
        .run();
}

Additional information

Repro repo https://github.com/colepoirier/bevy_app_construction_bug_repro.git, first commit is the working version, second commit is the repro of this app construction ordering bug.

Related to #1255

@colepoirier colepoirier added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Apr 1, 2022
@ickk
Copy link
Member

ickk commented Apr 1, 2022

related to: #2879

@colepoirier
Copy link
Contributor Author

related to: #2879

Ah fantastic! Thanks for pointing this out @ickk!

For quick reference it is first mentioned in this comment IIUC: #2879 (comment).

@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in and removed S-Needs-Triage This issue needs to be labelled labels Apr 3, 2022
@alice-i-cecile
Copy link
Member

Another cursed bug caused by #1255.

@rparrett
Copy link
Contributor

rparrett commented Nov 1, 2022

I believe this was fixed by #6336

@rparrett rparrett closed this as completed Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

4 participants