aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/mac.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-03-15 18:14:18 +0100
committerDavid Robillard <d@drobilla.net>2020-03-15 20:53:37 +0100
commit9f1467c2173c487e35522139abc54d583a4078e9 (patch)
tree0000ec7030bacf36d3b7590e78363201c9ada686 /pugl/detail/mac.m
parent1e7fe2208e53ae0d622b872803856b7bfb20cf23 (diff)
downloadpugl-9f1467c2173c487e35522139abc54d583a4078e9.tar.gz
pugl-9f1467c2173c487e35522139abc54d583a4078e9.tar.bz2
pugl-9f1467c2173c487e35522139abc54d583a4078e9.zip
Cleanup: Add puglDispatchSimpleEvent() internal utility
Diffstat (limited to 'pugl/detail/mac.m')
-rw-r--r--pugl/detail/mac.m12
1 files changed, 4 insertions, 8 deletions
diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m
index b4c52f0..2920675 100644
--- a/pugl/detail/mac.m
+++ b/pugl/detail/mac.m
@@ -101,11 +101,9 @@ updateViewRect(PuglView* view)
- (void) setIsVisible:(BOOL)flag
{
if (flag && !puglview->visible) {
- const PuglEvent map = {{PUGL_MAP, 0}};
- puglview->eventFunc(puglview, &map);
+ puglDispatchSimpleEvent(puglview, PUGL_MAP);
} else if (!flag && puglview->visible) {
- const PuglEvent unmap = {{PUGL_UNMAP, 0}};
- puglview->eventFunc(puglview, &unmap);
+ puglDispatchSimpleEvent(puglview, PUGL_UNMAP);
}
puglview->visible = flag;
@@ -659,8 +657,7 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type)
{
(void)sender;
- const PuglEvent ev = {{PUGL_CLOSE, 0}};
- puglDispatchEvent(window->puglview, &ev);
+ puglDispatchSimpleEvent(window->puglview, PUGL_CLOSE);
return YES;
}
@@ -824,8 +821,7 @@ puglCreateWindow(PuglView* view, const char* title)
[impl->wrapperView updateTrackingAreas];
- const PuglEvent createEvent = {{PUGL_CREATE, 0}};
- puglDispatchEvent(view, &createEvent);
+ puglDispatchSimpleEvent(view, PUGL_CREATE);
const PuglEventConfigure ev = {
PUGL_CONFIGURE,