aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-03-01 11:18:37 +0100
committerDavid Robillard <d@drobilla.net>2020-03-01 20:32:25 +0100
commitd7f0b78c32bc8da9461b8abed8722d15ddb0360a (patch)
tree226ca9487285b8f90577c31113960f7addfe393e /pugl/detail
parent56bdfc8c7827cfc2ebf151553a23bdeea55883a6 (diff)
downloadpugl-d7f0b78c32bc8da9461b8abed8722d15ddb0360a.tar.gz
pugl-d7f0b78c32bc8da9461b8abed8722d15ddb0360a.tar.bz2
pugl-d7f0b78c32bc8da9461b8abed8722d15ddb0360a.zip
Put PuglEventAny member of PuglEvent first for easy initialization
Diffstat (limited to 'pugl/detail')
-rw-r--r--pugl/detail/mac.m9
-rw-r--r--pugl/detail/x11.c2
2 files changed, 4 insertions, 7 deletions
diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m
index ca2cb7c..36499c0 100644
--- a/pugl/detail/mac.m
+++ b/pugl/detail/mac.m
@@ -643,8 +643,7 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type)
{
(void)sender;
- PuglEvent ev = { 0 };
- ev.type = PUGL_CLOSE;
+ const PuglEvent ev = {{PUGL_CLOSE, 0}};
puglDispatchEvent(window->puglview, &ev);
return YES;
}
@@ -666,8 +665,7 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type)
wrapperView->urgentTimer = NULL;
}
- PuglEvent ev = { 0 };
- ev.type = PUGL_FOCUS_IN;
+ PuglEvent ev = {{PUGL_FOCUS_IN, 0}};
ev.focus.grab = false;
puglDispatchEvent(window->puglview, &ev);
}
@@ -676,8 +674,7 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type)
{
(void)notification;
- PuglEvent ev = { 0 };
- ev.type = PUGL_FOCUS_OUT;
+ PuglEvent ev = {{PUGL_FOCUS_OUT, 0}};
ev.focus.grab = false;
puglDispatchEvent(window->puglview, &ev);
}
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index 38f10d0..9156c57 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -409,7 +409,7 @@ translateEvent(PuglView* view, XEvent xevent)
{
const PuglX11Atoms* atoms = &view->world->impl->atoms;
- PuglEvent event = {0};
+ PuglEvent event = {{PUGL_NOTHING, 0}};
event.any.flags = xevent.xany.send_event ? PUGL_IS_SEND_EVENT : 0;
switch (xevent.type) {