aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pugl/detail/mac.m5
-rw-r--r--pugl/detail/win.c5
-rw-r--r--pugl/detail/x11.c4
3 files changed, 11 insertions, 3 deletions
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];
}
diff --git a/pugl/detail/win.c b/pugl/detail/win.c
index 22a0a25..cb4dfad 100644
--- a/pugl/detail/win.c
+++ b/pugl/detail/win.c
@@ -828,7 +828,10 @@ puglUpdate(PuglWorld* world, double timeout)
}
for (size_t i = 0; i < world->numViews; ++i) {
- puglDispatchSimpleEvent(world->views[i], PUGL_UPDATE);
+ if (world->views[i]->visible) {
+ puglDispatchSimpleEvent(world->views[i], PUGL_UPDATE);
+ }
+
UpdateWindow(world->views[i]->impl->hwnd);
}
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index 58451e9..5fc769d 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -749,7 +749,9 @@ flushExposures(PuglWorld* world)
PuglEvent* const configure = &view->impl->pendingConfigure;
PuglEvent* const expose = &view->impl->pendingExpose;
- puglDispatchSimpleEvent(view, PUGL_UPDATE);
+ if (view->visible) {
+ puglDispatchSimpleEvent(view, PUGL_UPDATE);
+ }
if (configure->type || expose->type) {
view->backend->enter(view, expose->type ? &expose->expose : NULL);