aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_osx.m
diff options
context:
space:
mode:
authorStefan Westerfeld <stefan@space.twc.de>2019-06-23 17:41:43 +0200
committerDavid Robillard <d@drobilla.net>2019-06-27 19:41:48 +0200
commita978fd6a78baeb920e676cfef0d96877778c80ab (patch)
tree64b43b7a3a9389bde112246e6cb706717429d127 /pugl/pugl_osx.m
parentbf7bc771b2c6c77be9b935b8bfbf56677fba1754 (diff)
downloadpugl-a978fd6a78baeb920e676cfef0d96877778c80ab.tar.gz
pugl-a978fd6a78baeb920e676cfef0d96877778c80ab.tar.bz2
pugl-a978fd6a78baeb920e676cfef0d96877778c80ab.zip
Make event processing non-blocking on MacOS
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r--pugl/pugl_osx.m12
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) {