Skip to content

Commit b416d18

Browse files
authored
don't create windows on winit StartCause::Init event (#9684)
# Objective - #7609 broke Android support ``` 8721 8770 I event crates/bevy_winit/src/system.rs:55: Creating new window "App" (0v0) 8721 8769 I RustStdoutStderr: thread '<unnamed>' panicked at 'Cannot get the native window, it's null and will always be null before Event::Resumed and after Event::Suspended. Make sure you only call this function between those events.', winit-0.28.6/src/platform_impl/android/mod.rs:1058:13 ``` ## Solution - Don't create windows on `StartCause::Init` as it's too early
1 parent 0181d40 commit b416d18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_winit/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ pub fn winit_runner(mut app: App) {
366366
match event {
367367
event::Event::NewEvents(start_cause) => match start_cause {
368368
StartCause::Init => {
369-
#[cfg(any(target_os = "android", target_os = "ios", target_os = "macos"))]
369+
#[cfg(any(target_os = "ios", target_os = "macos"))]
370370
{
371371
#[cfg(not(target_arch = "wasm32"))]
372372
let (

0 commit comments

Comments
 (0)