aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-11 14:25:55 -0500
committerDavid Robillard <d@drobilla.net>2023-01-11 14:27:08 -0500
commit8ade9137d3ccd70efa19b9e23a7083a49691066a (patch)
treea8f52238b4265a5dfd7aa4468dde6dea9e34badf
parenta1b9aa4e4b5c8e663d134257b17afbd9dd8bc2ba (diff)
downloadpugl-8ade9137d3ccd70efa19b9e23a7083a49691066a.tar.gz
pugl-8ade9137d3ccd70efa19b9e23a7083a49691066a.tar.bz2
pugl-8ade9137d3ccd70efa19b9e23a7083a49691066a.zip
X11: Make puglSendEvent() gracefully handle unrealized views
-rw-r--r--src/x11.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/x11.c b/src/x11.c
index 96a7e17..2872612 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -1447,6 +1447,9 @@ puglSendEvent(PuglView* const view, const PuglEvent* const event)
PuglInternals* const impl = view->impl;
Display* const display = view->world->impl->display;
XEvent xev = PUGL_INIT_STRUCT;
+ if (!impl->win) {
+ return PUGL_FAILURE;
+ }
if (event->type == PUGL_CLOSE) {
xev.xclient.type = ClientMessage;