summaryrefslogtreecommitdiff
path: root/pugl/pugl_osx.m
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r--pugl/pugl_osx.m20
1 files changed, 17 insertions, 3 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m
index 85e71a8..f41c863 100644
--- a/pugl/pugl_osx.m
+++ b/pugl/pugl_osx.m
@@ -1,5 +1,5 @@
/*
- Copyright 2012-2014 David Robillard <http://drobilla.net>
+ Copyright 2012-2015 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@@ -525,10 +525,24 @@ puglGrabFocus(PuglView* view)
}
PuglStatus
+puglWaitForEvent(PuglView* view)
+{
+ [view->impl->window nextEventMatchingMask: NSAnyEventMask
+ untilDate: [NSDate distantFuture]
+ dequeue: NO];
+
+ return PUGL_SUCCESS;
+}
+
+PuglStatus
puglProcessEvents(PuglView* view)
{
- NSEvent* ev = [view->impl->window nextEventMatchingMask: NSAnyEventMask];
- [view->impl->app sendEvent: ev];
+ NSEvent* ev = [view->impl->window nextEventMatchingMask: NSAnyEventMask
+ untilDate: [NSDate distantPast]];
+
+ if (ev) {
+ [view->impl->app sendEvent: ev];
+ }
return PUGL_SUCCESS;
}