mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-12 05:31:31 +11:00
Merge pull request #153 from MortimerGoro/android_events
Implement android events and wake event loop
This commit is contained in:
commit
6850a2f76f
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "winit"
|
name = "winit"
|
||||||
version = "0.6.0"
|
version = "0.6.1"
|
||||||
authors = ["The winit contributors, Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
authors = ["The winit contributors, Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||||
description = "Cross-platform window creation library."
|
description = "Cross-platform window creation library."
|
||||||
keywords = ["windowing"]
|
keywords = ["windowing"]
|
||||||
|
|
|
@ -83,6 +83,23 @@ impl<'a> Iterator for PollEventsIterator<'a> {
|
||||||
location: (motion.x as f64, motion.y as f64),
|
location: (motion.x as f64, motion.y as f64),
|
||||||
id: motion.pointer_id as u64,
|
id: motion.pointer_id as u64,
|
||||||
}))
|
}))
|
||||||
|
},
|
||||||
|
Ok(android_glue::Event::InitWindow) => {
|
||||||
|
// The activity went to foreground.
|
||||||
|
Some(Event::Suspended(false))
|
||||||
|
},
|
||||||
|
Ok(android_glue::Event::TermWindow) => {
|
||||||
|
// The activity went to background.
|
||||||
|
Some(Event::Suspended(true))
|
||||||
|
},
|
||||||
|
Ok(android_glue::Event::WindowResized) |
|
||||||
|
Ok(android_glue::Event::ConfigChanged) => {
|
||||||
|
// Activity Orientation changed or resized.
|
||||||
|
self.window.get_inner_size().map(|s| Event::Resized(s.0, s.1))
|
||||||
|
},
|
||||||
|
Ok(android_glue::Event::WindowRedrawNeeded) => {
|
||||||
|
// The activity needs to be redrawn.
|
||||||
|
Some(Event::Refresh)
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
None
|
None
|
||||||
|
@ -253,6 +270,6 @@ pub struct WindowProxy;
|
||||||
impl WindowProxy {
|
impl WindowProxy {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn wakeup_event_loop(&self) {
|
pub fn wakeup_event_loop(&self) {
|
||||||
unimplemented!()
|
android_glue::wake_event_loop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue