diff options
author | David Robillard <d@drobilla.net> | 2016-09-01 22:25:07 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-09-01 22:25:07 -0400 |
commit | 252421757e4e8ca9f482f2885ef9c09492c06757 (patch) | |
tree | 46d547e2e7c205e29211cbd6c8eb5f1516b6f1f3 /pugl | |
parent | ddfcee0fd3e6daf7174497c6a7183d83651a5c88 (diff) | |
download | pugl-252421757e4e8ca9f482f2885ef9c09492c06757.tar.gz pugl-252421757e4e8ca9f482f2885ef9c09492c06757.tar.bz2 pugl-252421757e4e8ca9f482f2885ef9c09492c06757.zip |
Enter context before dispatching expose/configure
Diffstat (limited to 'pugl')
-rw-r--r-- | pugl/pugl_internal.h | 8 |
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) { |