From 8f9ddfe3c275dbb69e15f8d1cc163a6a3b728634 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. (cherry picked from commit 3203599cac774c4aa48dc17eb963f4a90c6d70ff) --- 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 a95c37ba..459f4b5b 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -612,8 +612,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); + } } }