aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_internal.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-09-01 22:25:07 -0400
committerDavid Robillard <d@drobilla.net>2016-09-01 22:25:07 -0400
commit252421757e4e8ca9f482f2885ef9c09492c06757 (patch)
tree46d547e2e7c205e29211cbd6c8eb5f1516b6f1f3 /pugl/pugl_internal.h
parentddfcee0fd3e6daf7174497c6a7183d83651a5c88 (diff)
downloadpugl-252421757e4e8ca9f482f2885ef9c09492c06757.tar.gz
pugl-252421757e4e8ca9f482f2885ef9c09492c06757.tar.bz2
pugl-252421757e4e8ca9f482f2885ef9c09492c06757.zip
Enter context before dispatching expose/configure
Diffstat (limited to 'pugl/pugl_internal.h')
-rw-r--r--pugl/pugl_internal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/pugl/pugl_internal.h b/pugl/pugl_internal.h
index d9dfdfa..23abebf 100644
--- a/pugl/pugl_internal.h
+++ b/pugl/pugl_internal.h
@@ -293,7 +293,15 @@ puglDispatchEvent(PuglView* view, const PuglEvent* event)
if (event->type == PUGL_NOTHING) {
return;
} else if (view->eventFunc) {
+ const bool is_draw = (event->type == PUGL_CONFIGURE ||
+ event->type == PUGL_EXPOSE);
+ if (is_draw) {
+ puglEnterContext(view);
+ }
view->eventFunc(view, event);
+ if (is_draw) {
+ puglLeaveContext(view, event->type == PUGL_EXPOSE);
+ }
}
switch (event->type) {