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 3203599cac)
This commit is contained in:
Camilla Löwy 2022-06-20 22:21:41 +02:00
parent 4c7f6ada0c
commit 8f9ddfe3c2

View File

@ -611,10 +611,15 @@ static void xdgSurfaceHandleConfigure(void* userData,
} }
if (!window->wl.visible) if (!window->wl.visible)
{
// 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; window->wl.visible = GLFW_TRUE;
_glfwInputWindowDamage(window); _glfwInputWindowDamage(window);
} }
}
} }
static const struct xdg_surface_listener xdgSurfaceListener = static const struct xdg_surface_listener xdgSurfaceListener =