aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}