Skip to content

Commit 1d0d57f

Browse files
committed
Android: Bump ndk/ndk-glue to 0.3 and use constants for event ident
Following the changes in [1] this bumps ndk and ndk-glue to 0.3 and uses the new constants. The minor version has been bumped to prevent applications from running an older winit (without rust-windowing#1826) with a newer ndk/ndk-glue that does not pass this `ident` through the `data` pointer anymore. [1]: rust-mobile/ndk#112
1 parent f79c01b commit 1d0d57f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- On Windows, fix bug causing mouse capture to not be released.
77
- On Windows, fix fullscreen not preserving minimized/maximized state.
88
- On Android, unimplemented events are marked as unhandled on the native event loop.
9+
- On Android, bump `ndk` and `ndk-glue` to 0.3: use predefined constants for event `ident`.
910

1011
# 0.24.0 (2020-12-09)
1112

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ image = "0.23.12"
3737
simple_logger = "1.9"
3838

3939
[target.'cfg(target_os = "android")'.dependencies]
40-
ndk = "0.2.0"
40+
ndk = "0.3"
4141
ndk-sys = "0.2.0"
42-
ndk-glue = "0.2.0"
42+
ndk-glue = "0.3"
4343

4444
[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies]
4545
objc = "0.2.7"

src/platform_impl/android/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ enum EventSource {
3131
fn poll(poll: Poll) -> Option<EventSource> {
3232
match poll {
3333
Poll::Event { ident, .. } => match ident {
34-
0 => Some(EventSource::Callback),
35-
1 => Some(EventSource::InputQueue),
34+
ndk_glue::NDK_GLUE_LOOPER_EVENT_PIPE_IDENT => Some(EventSource::Callback),
35+
ndk_glue::NDK_GLUE_LOOPER_INPUT_QUEUE_IDENT => Some(EventSource::InputQueue),
3636
_ => unreachable!(),
3737
},
3838
Poll::Timeout => None,

0 commit comments

Comments
 (0)