From dc8fc6cb34d6064530c698f30445cd69d1c79682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Garc=C3=ADa=20Ruiz?= <55754091+hecksmosis@users.noreply.github.com> Date: Tue, 19 Dec 2023 21:15:03 +0100 Subject: [PATCH] Reexport winit::platform::android::activity::* in bevy_winit (#11011) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Objective - Fixes #10630 ## Solution - Reexport winit::platform::android::activity::* in bevy_init --------- Co-authored-by: François --- crates/bevy_derive/src/bevy_main.rs | 2 +- crates/bevy_winit/src/lib.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/bevy_derive/src/bevy_main.rs b/crates/bevy_derive/src/bevy_main.rs index ac7d6a5e9d1a8..d4504331a6467 100644 --- a/crates/bevy_derive/src/bevy_main.rs +++ b/crates/bevy_derive/src/bevy_main.rs @@ -12,7 +12,7 @@ pub fn bevy_main(_attr: TokenStream, item: TokenStream) -> TokenStream { TokenStream::from(quote! { #[no_mangle] #[cfg(target_os = "android")] - fn android_main(android_app: bevy::winit::AndroidApp) { + fn android_main(android_app: bevy::winit::android_activity::AndroidApp) { let _ = bevy::winit::ANDROID_APP.set(android_app); main(); } diff --git a/crates/bevy_winit/src/lib.rs b/crates/bevy_winit/src/lib.rs index 4a9696d751dd2..ef155f220f8cb 100644 --- a/crates/bevy_winit/src/lib.rs +++ b/crates/bevy_winit/src/lib.rs @@ -47,7 +47,7 @@ use bevy_window::{ use bevy_window::{PrimaryWindow, RawHandleWrapper}; #[cfg(target_os = "android")] -pub use winit::platform::android::activity::AndroidApp; +pub use winit::platform::android::activity as android_activity; use winit::{ event::{self, DeviceEvent, Event, StartCause, WindowEvent}, @@ -63,7 +63,8 @@ use crate::web_resize::{CanvasParentResizeEventChannel, CanvasParentResizePlugin /// [`AndroidApp`] provides an interface to query the application state as well as monitor events /// (for example lifecycle and input events). #[cfg(target_os = "android")] -pub static ANDROID_APP: std::sync::OnceLock = std::sync::OnceLock::new(); +pub static ANDROID_APP: std::sync::OnceLock = + std::sync::OnceLock::new(); /// A [`Plugin`] that uses `winit` to create and manage windows, and receive window and input /// events.