aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_internal.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-09-01 22:26:22 -0400
committerDavid Robillard <d@drobilla.net>2016-09-01 22:26:22 -0400
commit02d2704a0be7443907f5752c00b71feb58cc11dd (patch)
treef2d22fd08c10b2ff1f7762d0dc8feb3561aafa5d /pugl/pugl_internal.h
parent252421757e4e8ca9f482f2885ef9c09492c06757 (diff)
downloadpugl-02d2704a0be7443907f5752c00b71feb58cc11dd.tar.gz
pugl-02d2704a0be7443907f5752c00b71feb58cc11dd.tar.bz2
pugl-02d2704a0be7443907f5752c00b71feb58cc11dd.zip
Add PUGL_CLOSE event
This allows purely event-driven applications to handle window close. Something more extensible for WM message seems like it might be a good idea here, but I can't think of specific uses, so this will do.
Diffstat (limited to 'pugl/pugl_internal.h')
-rw-r--r--pugl/pugl_internal.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/pugl/pugl_internal.h b/pugl/pugl_internal.h
index 23abebf..d4ba126 100644
--- a/pugl/pugl_internal.h
+++ b/pugl/pugl_internal.h
@@ -324,6 +324,12 @@ puglDispatchEvent(PuglView* view, const PuglEvent* event)
puglLeaveContext(view, true);
}
break;
+ case PUGL_CLOSE:
+ if (view->closeFunc) {
+ view->closeFunc(view);
+ }
+ view->redisplay = false;
+ break;
case PUGL_MOTION_NOTIFY:
view->event_timestamp_ms = event->motion.time;
view->mods = event->motion.state;