diff options
author | David Robillard <d@drobilla.net> | 2020-03-16 16:13:56 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-03-16 16:13:56 +0100 |
commit | 1be8849a305d6ced92e750f954a71d305f846e9c (patch) | |
tree | 5160eda59be32a09bfbe6b1ac581e2de8406994e /pugl | |
parent | 30803f50fafbe9d86dafa74854dcaeee30195f29 (diff) | |
download | pugl-1be8849a305d6ced92e750f954a71d305f846e9c.tar.gz pugl-1be8849a305d6ced92e750f954a71d305f846e9c.tar.bz2 pugl-1be8849a305d6ced92e750f954a71d305f846e9c.zip |
MacOS: Fix semantics of puglUpdate() with negative timeout
Diffstat (limited to 'pugl')
-rw-r--r-- | pugl/detail/mac.m | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m index fcf5912..23fad7b 100644 --- a/pugl/detail/mac.m +++ b/pugl/detail/mac.m @@ -991,6 +991,12 @@ puglUpdate(PuglWorld* world, const double timeout) } [world->impl->app sendEvent: ev]; + + if (timeout < 0) { + // Now that we've waited and got an event, set the date to now to + // avoid looping forever + date = [NSDate date]; + } } for (size_t i = 0; i < world->numViews; ++i) { |