From 3203599cac774c4aa48dc17eb963f4a90c6d70ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 20 Jun 2022 22:21:41 +0200 Subject: [PATCH] Wayland: Fix map before XDG decoration configure If the xdg_toplevel has a decoration, we need to wait for its first configure event as well before we are allowed to attach the first buffer. It seems racy to assume that this will always happen inside the first surface configure sequence, so this commit makes that condition explicit. This may turn out to have been overly defensive. --- src/wl_window.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index 44f1df7b..737274f7 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -569,8 +569,13 @@ static void xdgSurfaceHandleConfigure(void* userData, if (!window->wl.visible) { - window->wl.visible = GLFW_TRUE; - _glfwInputWindowDamage(window); + // Allow the window to be mapped only if it either has no XDG + // decorations or they have already received a configure event + if (!window->wl.xdg.decoration || window->wl.xdg.decorationMode) + { + window->wl.visible = GLFW_TRUE; + _glfwInputWindowDamage(window); + } } }