diff options
author | David Robillard <d@drobilla.net> | 2015-09-13 16:24:45 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-09-13 16:24:45 -0400 |
commit | add00976a0c39f78f57df79c2a194c4f4e7adbf7 (patch) | |
tree | 0ac8e24a7d09faa2b6d177d147d471555cc09af6 /pugl/pugl_osx.m | |
parent | 7c1f22fdf4782aa04a14a914b5a51b3617362366 (diff) | |
parent | d457ac139797b05fdc214f8af458833b58033224 (diff) | |
download | pugl-add00976a0c39f78f57df79c2a194c4f4e7adbf7.tar.gz pugl-add00976a0c39f78f57df79c2a194c4f4e7adbf7.tar.bz2 pugl-add00976a0c39f78f57df79c2a194c4f4e7adbf7.zip |
Merge branch 'master' of git.drobilla.net:/home/drobilla/git.drobilla.net/pugl
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r-- | pugl/pugl_osx.m | 20 |
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; } |