aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Watson <gw@intuitionlibrary.com>2014-12-18 14:22:58 +1000
committerGlenn Watson <gw@intuitionlibrary.com>2014-12-18 14:26:02 +1000
commit2c150143d8da8bded7d9441ef08f67eab51db7c4 (patch)
treeb54fb466abc1a1c35ea019ccf879060baa85a0a0
parent435c64f4732dbf6fa4e92d04a962e42e34f21f1a (diff)
downloadglutin-2c150143d8da8bded7d9441ef08f67eab51db7c4.tar.gz
glutin-2c150143d8da8bded7d9441ef08f67eab51db7c4.zip
Add mac implementation of wakeup_event_loop.
-rw-r--r--src/osx/mod.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/osx/mod.rs b/src/osx/mod.rs
index 3f9da82..22ae432 100644
--- a/src/osx/mod.rs
+++ b/src/osx/mod.rs
@@ -80,7 +80,23 @@ pub struct WindowProxy;
impl WindowProxy {
pub fn wakeup_event_loop(&self) {
- // TODO
+ unsafe {
+ let pool = NSAutoreleasePool::new(nil);
+ let event =
+ NSEvent::otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2(
+ nil,
+ NSApplicationDefined,
+ NSPoint::new(0.0, 0.0),
+ 0,
+ 0.0,
+ 0,
+ ptr::null_mut(),
+ 0,
+ 0,
+ 0);
+ NSApp().postEvent_atStart_(event, true);
+ pool.drain();
+ }
}
}