diff --git a/Cargo.toml b/Cargo.toml index 933559e68..3436f9996 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,9 @@ targets = [ [features] default = [ "rwh_06" ] serde = [ "dep:serde", "dpi/serde" ] +rwh_04 = [ "dep:rwh_04" ] +rwh_05 = [ "dep:rwh_05" ] +rwh_06 = [ "dep:rwh_06" ] [workspace] members = [ "tao-macros" ] diff --git a/src/platform_impl/android/mod.rs b/src/platform_impl/android/mod.rs index 19d8e1b04..e489732db 100644 --- a/src/platform_impl/android/mod.rs +++ b/src/platform_impl/android/mod.rs @@ -700,7 +700,7 @@ impl Window { pub fn raw_window_handle_rwh_04(&self) -> rwh_04::RawWindowHandle { // TODO: Use main activity instead? let mut handle = rwh_04::AndroidNdkHandle::empty(); - if let Some(w) = ndk_glue::window_manager() { + if let Some(w) = ndk_glue::window_manager().as_ref() { handle.a_native_window = w.as_obj().as_raw() as *mut _; } else { panic!("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."); @@ -712,7 +712,7 @@ impl Window { pub fn raw_window_handle_rwh_05(&self) -> rwh_05::RawWindowHandle { // TODO: Use main activity instead? let mut handle = rwh_05::AndroidNdkWindowHandle::empty(); - if let Some(w) = ndk_glue::window_manager() { + if let Some(w) = ndk_glue::window_manager().as_ref() { handle.a_native_window = w.as_obj().as_raw() as *mut _; } else { panic!("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.");