Skip to content

Commit

Permalink
fix(android): fix compile when rwh_04 or rwh_05 is active
Browse files Browse the repository at this point in the history
closes #1011
  • Loading branch information
amrbashir committed Nov 11, 2024
1 parent 73741a7 commit 8465bf7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
4 changes: 2 additions & 2 deletions src/platform_impl/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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.");
Expand Down

0 comments on commit 8465bf7

Please sign in to comment.