diff options
-rw-r--r-- | pugl/detail/x11.c | 6 | ||||
-rw-r--r-- | test/test_redisplay.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c index 2d74b68..ce9e289 100644 --- a/pugl/detail/x11.c +++ b/pugl/detail/x11.c @@ -960,8 +960,10 @@ handleTimerEvent(PuglWorld* world, XEvent xevent) for (size_t i = 0; i < world->impl->numTimers; ++i) { if (world->impl->timers[i].alarm == notify->alarm) { - const PuglEventTimer ev = {PUGL_TIMER, 0, world->impl->timers[i].id}; - puglDispatchEvent(world->impl->timers[i].view, (const PuglEvent*)&ev); + PuglEvent event = {{PUGL_TIMER, 0}}; + event.timer.id = world->impl->timers[i].id; + puglDispatchEvent(world->impl->timers[i].view, + (const PuglEvent*)&event); } } diff --git a/test/test_redisplay.c b/test/test_redisplay.c index 0e14cf6..108a433 100644 --- a/test/test_redisplay.c +++ b/test/test_redisplay.c @@ -121,8 +121,10 @@ main(int argc, char** argv) } // Send a custom event to trigger a redisplay in the event loop - const PuglEventClient client = { PUGL_CLIENT, 0, postRedisplayId, 0 }; - assert(!puglSendEvent(app.view, (const PuglEvent*)&client)); + PuglEvent client_event = {{PUGL_CLIENT, 0}}; + client_event.client.data1 = postRedisplayId; + client_event.client.data2 = 0; + assert(!puglSendEvent(app.view, &client_event)); // Loop until an expose happens in the same iteration as the redisplay app.state = SHOULD_REDISPLAY; |