aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-06-03 21:52:55 -0400
committerDavid Robillard <d@drobilla.net>2022-06-07 10:15:21 -0400
commitd462f742adfbb1188105d5b7470aa4ddc4ac80fd (patch)
treed7c5d9e6e8c8a60db504e670541d9b83f4f9bc98
parent677b18968410ce9bf2cdd117d3fd9cd7d1336d30 (diff)
downloadpugl-d462f742adfbb1188105d5b7470aa4ddc4ac80fd.tar.gz
pugl-d462f742adfbb1188105d5b7470aa4ddc4ac80fd.tar.bz2
pugl-d462f742adfbb1188105d5b7470aa4ddc4ac80fd.zip
X11: Flush before returning from puglRealize()
This avoids bugs in plugins, because otherwise it's possible that size hints are not available when the host embeds the UI.
-rw-r--r--src/x11.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/x11.c b/src/x11.c
index b9845fc..7800fed 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -470,6 +470,14 @@ puglRealize(PuglView* const view)
puglDispatchSimpleEvent(view, PUGL_CREATE);
+ /* Flush before returning for two reasons: so that hints are available to the
+ view's parent via the X server during embedding, and so that the X server
+ has a chance to create the window (and make its actual position and size
+ known) before any children are created. Potential bugs aside, this
+ increases the chances that an application will be cleanly configured once
+ on startup with the correct position and size. */
+ XFlush(display);
+
return PUGL_SUCCESS;
}