diff options
author | Stefan Westerfeld <stefan@space.twc.de> | 2019-06-23 17:41:43 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-06-27 19:41:48 +0200 |
commit | a978fd6a78baeb920e676cfef0d96877778c80ab (patch) | |
tree | 64b43b7a3a9389bde112246e6cb706717429d127 | |
parent | bf7bc771b2c6c77be9b935b8bfbf56677fba1754 (diff) |
Make event processing non-blocking on MacOS
-rw-r--r-- | pugl/pugl_osx.m | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m index aaae212..be900f1 100644 --- a/pugl/pugl_osx.m +++ b/pugl/pugl_osx.m @@ -677,8 +677,8 @@ puglWaitForEvent(PuglView* view) unsupported selector error at runtime. I have no idea why, so just get the event and keep it around until the call to puglProcessEvents. */ if (!view->impl->nextEvent) { - view->impl->nextEvent = [view->impl->window - nextEventMatchingMask: NSAnyEventMask]; + view->impl->nextEvent = + [view->impl->window nextEventMatchingMask:NSAnyEventMask]; } return PUGL_SUCCESS; @@ -690,8 +690,12 @@ puglProcessEvents(PuglView* view) while (true) { // Get the next event, or use the cached one from puglWaitForEvent if (!view->impl->nextEvent) { - view->impl->nextEvent = [view->impl->window - nextEventMatchingMask: NSAnyEventMask]; + view->impl->nextEvent = + [view->impl->window nextEventMatchingMask:NSAnyEventMask + untilDate:nil + inMode:NSDefaultRunLoopMode + dequeue:YES]; + } if (!view->impl->nextEvent) { |