From 28dd64df0186089f9534881550c2efaa6b7dc95c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 16 Mar 2020 16:13:48 +0100 Subject: Only send update events when the view is visible --- pugl/detail/mac.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pugl/detail/mac.m') diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m index 22f8088..2ec4345 100644 --- a/pugl/detail/mac.m +++ b/pugl/detail/mac.m @@ -997,7 +997,10 @@ puglUpdate(PuglWorld* world, const double timeout) for (size_t i = 0; i < world->numViews; ++i) { PuglView* const view = world->views[i]; - puglDispatchSimpleEvent(view, PUGL_UPDATE); + if ([[view->impl->drawView window] isVisible]) { + puglDispatchSimpleEvent(view, PUGL_UPDATE); + } + [view->impl->drawView displayIfNeeded]; } -- cgit v1.2.1