aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/x11.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-10-19 12:15:55 +0200
committerDavid Robillard <d@drobilla.net>2020-10-19 12:47:39 +0200
commita87395423915f913b819291b3b4920501cccdf95 (patch)
treec748467f9923d3f120abb64cd8ce12f367abab19 /pugl/detail/x11.c
parentf2e294f99b42becc35588673f45a2d536e1091fa (diff)
downloadpugl-a87395423915f913b819291b3b4920501cccdf95.tar.gz
pugl-a87395423915f913b819291b3b4920501cccdf95.tar.bz2
pugl-a87395423915f913b819291b3b4920501cccdf95.zip
Gracefully handle puglRealize() being called twice
Diffstat (limited to 'pugl/detail/x11.c')
-rw-r--r--pugl/detail/x11.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index f9a45e8..e6444c8 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -278,7 +278,11 @@ puglDefineCursorShape(PuglView* view, unsigned shape)
PuglStatus
puglRealize(PuglView* view)
{
- PuglInternals* const impl = view->impl;
+ PuglInternals* const impl = view->impl;
+ if (impl->win) {
+ return PUGL_FAILURE;
+ }
+
PuglWorld* const world = view->world;
PuglX11Atoms* const atoms = &view->world->impl->atoms;
Display* const display = world->impl->display;