From 1073ef1b714dfffd734898b48da27c9b023d4f89 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 11 Jan 2023 14:26:47 -0500 Subject: X11: Fix puglPostRedisplay() outside of event handlers --- src/x11.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/x11.c b/src/x11.c index 2872612..54fc6d1 100644 --- a/src/x11.c +++ b/src/x11.c @@ -739,7 +739,9 @@ puglShow(PuglView* const view, const PuglShowCommand command) break; } - st = puglPostRedisplay(view); + if (view->stage == PUGL_VIEW_STAGE_CONFIGURED) { + st = puglPostRedisplay(view); + } } return st; @@ -1863,7 +1865,7 @@ puglPostRedisplayRect(PuglView* const view, const PuglRect rect) if (view->world->impl->dispatchingEvents) { // Currently dispatching events, add/expand expose for the loop end mergeExposeEvents(&view->impl->pendingExpose.expose, &event); - } else if (view->stage == PUGL_VIEW_STAGE_CONFIGURED) { + } else if (view->impl->win) { // Not dispatching events, send an X expose so we wake up next time PuglEvent exposeEvent = {{PUGL_EXPOSE, 0}}; exposeEvent.expose = event; -- cgit v1.2.1