From 918833b19fee978119839d1ddfe01912fc13c4d3 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Fri, 20 Mar 2015 08:06:46 +1000 Subject: [PATCH] Fix waking up mac event loop from thread. --- src/cocoa/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cocoa/mod.rs b/src/cocoa/mod.rs index ee3b03f6..fc031985 100644 --- a/src/cocoa/mod.rs +++ b/src/cocoa/mod.rs @@ -30,7 +30,7 @@ use std::str::from_utf8; use std::sync::Mutex; 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::MouseButton; use events; @@ -333,6 +333,8 @@ impl<'a> Iterator for WaitEventsIterator<'a> { // calling poll_events() if let Some(ev) = self.window.poll_events().next() { return Some(ev); + } else { + return Some(Awakened); } } }