From d462f742adfbb1188105d5b7470aa4ddc4ac80fd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 3 Jun 2022 21:52:55 -0400 Subject: 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. --- src/x11.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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; } -- cgit v1.2.1