aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-10-25 17:55:03 +0100
committerDavid Robillard <d@drobilla.net>2020-10-26 11:01:08 +0100
commitfd8743c798665a39164a336638aca48642c77b85 (patch)
tree40061e362a5fc88e631be655d1841d4d95f2f92c
parent612aae5147abec2be9523c1d2858550e5d8a150d (diff)
downloadpugl-fd8743c798665a39164a336638aca48642c77b85.tar.gz
pugl-fd8743c798665a39164a336638aca48642c77b85.tar.bz2
pugl-fd8743c798665a39164a336638aca48642c77b85.zip
Don't send expose events when window is minimized
-rw-r--r--include/pugl/detail/implementation.c6
1 files changed, 5 insertions, 1 deletions
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: