Skip to content

Commit

Permalink
I forgot finished_and_setup_done
Browse files Browse the repository at this point in the history
  • Loading branch information
maniwani committed Jul 25, 2023
1 parent fc1dc5e commit 4f09919
Showing 1 changed file with 39 additions and 38 deletions.
77 changes: 39 additions & 38 deletions crates/bevy_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ pub fn winit_runner(mut app: App) {
}
};

if should_update {
if finished_and_setup_done && should_update {
// reset these on each update
runner_state.wait_elapsed = false;
runner_state.device_event_received = false;
Expand Down Expand Up @@ -738,46 +738,47 @@ pub fn winit_runner(mut app: App) {
*control_flow = ControlFlow::Exit;
}
}
}

// create any new windows
#[cfg(not(target_arch = "wasm32"))]
let (
commands,
mut windows,
event_writer,
winit_windows,
adapters,
handlers,
accessibility_requested,
) = create_window_system_state.get_mut(&mut app.world);

// create any new windows
// (even if app did not update, some may have been created by plugin setup)
#[cfg(not(target_arch = "wasm32"))]
let (
commands,
mut windows,
event_writer,
winit_windows,
adapters,
handlers,
accessibility_requested,
) = create_window_system_state.get_mut(&mut app.world);

#[cfg(target_arch = "wasm32")]
let (
commands,
mut windows,
event_writer,
winit_windows,
adapters,
handlers,
accessibility_requested,
event_channel,
) = create_window_system_state.get_mut(&mut app.world);

create_windows(
event_loop,
commands,
windows.iter_mut(),
event_writer,
winit_windows,
adapters,
handlers,
accessibility_requested,
#[cfg(target_arch = "wasm32")]
let (
commands,
mut windows,
event_writer,
winit_windows,
adapters,
handlers,
accessibility_requested,
event_channel,
) = create_window_system_state.get_mut(&mut app.world);

create_windows(
event_loop,
commands,
windows.iter_mut(),
event_writer,
winit_windows,
adapters,
handlers,
accessibility_requested,
#[cfg(target_arch = "wasm32")]
event_channel,
);
event_channel,
);

create_window_system_state.apply(&mut app.world);
}
create_window_system_state.apply(&mut app.world);
}
}
_ => (),
Expand Down

0 comments on commit 4f09919

Please sign in to comment.