Skip to content
Discussion options

You must be logged in to vote

Yes. In Bevy 0.19, changing Window::focused from false to true makes bevy_winit call winit's focus_window().

There are two details worth handling in the delayed-visibility example:

  1. focused defaults to true, so setting it to true later would not be a change and would not issue a new request.
  2. Bevy propagates the focus change before the visibility change. Requesting both in the same update can therefore ask the backend to focus a window that is still hidden.

Start the window unfocused, show it, then request focus on the next update:

primary_window: Some(Window {
    visible: false,
    focused: false,
    ..default()
}),
fn make_visible_and_focus(
    mut window: Single<&mut Window>,
    f…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by QueenOfSquiggles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants