From 1be8849a305d6ced92e750f954a71d305f846e9c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 16 Mar 2020 16:13:56 +0100 Subject: MacOS: Fix semantics of puglUpdate() with negative timeout --- pugl/detail/mac.m | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- cgit v1.2.1