From fd8743c798665a39164a336638aca48642c77b85 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 25 Oct 2020 17:55:03 +0100 Subject: Don't send expose events when window is minimized --- include/pugl/detail/implementation.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/pugl/detail/implementation.c b/include/pugl/detail/implementation.c index f15b856..4f0776a 100644 --- a/include/pugl/detail/implementation.c +++ b/include/pugl/detail/implementation.c @@ -418,6 +418,10 @@ puglDispatchEventInContext(PuglView* view, const PuglEvent* event) view->eventFunc(view, event); view->lastConfigure = event->configure; } + } else if (event->type == PUGL_EXPOSE) { + if (event->expose.width > 0 && event->expose.height > 0) { + view->eventFunc(view, event); + } } else { view->eventFunc(view, event); } @@ -444,7 +448,7 @@ puglDispatchEvent(PuglView* view, const PuglEvent* event) break; case PUGL_EXPOSE: view->backend->enter(view, &event->expose); - view->eventFunc(view, event); + puglDispatchEventInContext(view, event); view->backend->leave(view, &event->expose); break; default: -- cgit v1.2.1