don't create windows on winit StartCause::Init event (#9684)
# Objective - https://github.com/bevyengine/bevy/pull/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
This commit is contained in:
		
							parent
							
								
									0181d40d83
								
							
						
					
					
						commit
						b416d181a7
					
				@ -366,7 +366,7 @@ pub fn winit_runner(mut app: App) {
 | 
				
			|||||||
        match event {
 | 
					        match event {
 | 
				
			||||||
            event::Event::NewEvents(start_cause) => match start_cause {
 | 
					            event::Event::NewEvents(start_cause) => match start_cause {
 | 
				
			||||||
                StartCause::Init => {
 | 
					                StartCause::Init => {
 | 
				
			||||||
                    #[cfg(any(target_os = "android", target_os = "ios", target_os = "macos"))]
 | 
					                    #[cfg(any(target_os = "ios", target_os = "macos"))]
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        #[cfg(not(target_arch = "wasm32"))]
 | 
					                        #[cfg(not(target_arch = "wasm32"))]
 | 
				
			||||||
                        let (
 | 
					                        let (
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user