mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
Merge pull request #318 from glennw/thread-wake-mac
Fix waking up mac event loop from thread.
This commit is contained in:
commit
a6485045f1
|
@ -30,7 +30,7 @@ use std::str::from_utf8;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
|
|
||||||
use events::Event::{MouseInput, MouseMoved, ReceivedCharacter, KeyboardInput, MouseWheel};
|
use events::Event::{Awakened, MouseInput, MouseMoved, ReceivedCharacter, KeyboardInput, MouseWheel};
|
||||||
use events::ElementState::{Pressed, Released};
|
use events::ElementState::{Pressed, Released};
|
||||||
use events::MouseButton;
|
use events::MouseButton;
|
||||||
use events;
|
use events;
|
||||||
|
@ -333,6 +333,8 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
|
||||||
// calling poll_events()
|
// calling poll_events()
|
||||||
if let Some(ev) = self.window.poll_events().next() {
|
if let Some(ev) = self.window.poll_events().next() {
|
||||||
return Some(ev);
|
return Some(ev);
|
||||||
|
} else {
|
||||||
|
return Some(Awakened);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue