Skip to content

bug: cannot create an unfocused window on Mac for dev #15025

Description

@swarnimarun

Bevy version

v0.14.1

[Optional] Relevant system information

On, MacOS 14.2.1

SystemInfo { os: "MacOS 14.2.1 ", kernel: "23.2.0", cpu: "Apple M1 Pro", core_count: "8", memory: "16.0 GiB" }

What you did

Setting focused false doesn't work when running app from terminal.

        .add_plugins(DefaultPlugins.set(WindowPlugin {
            primary_window: Some(Window {
            	present_mode: bevy::window::PresentMode::Immediate,
                // ignore this two, set as I am using multiple monitors
                position: WindowPosition::Centered(MonitorSelection::Index(0)),
                focused: false, // here!
                ..default()
            }),
            ..default()
        }))

What went wrong

Ideally the window should not grab focus when set to focused false or so I understand from the docs, I might be wrong. In that case I would like an set_active false flag. And maybe we can reword the docs a bit better.

Additional information

You can fix it if you build the event loop directly by setting, with_activate_ignoring_other_apps to false, but I am not sure how to do this with bevy. (better described here, rust-windowing/winit#3072)

I can't seem to be able to access the event loop in any way.
So it might not be a bug, just a skill issue on my part. But I think even if we could, it's at best a workaround.

It's nice to be able to do it, as I can set cargo watch -x run and see my changes instantly. Especially for game jam projects which are small and require quick tweaks/iteration.

Aside:
Awesome work on the project, appreciate the effort from all the bevy folks, I lack time to write my own libs for my hobby indie game dev projects in Rust. So it's awesome to have such a impressive go-to-ish library in Rust for it. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WindowingPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorO-MacOSSpecific to the MacOS (Apple) desktop operating systemS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions