wayland: Don't create zxdg toplevel decoration twice

Each window can have at most one zxdg toplevel decoration, but as of
[1], we accidentally create two. (If libdecor is not in use). This
causes wayland windows with server-side decorations (e.g. on KDE/KWin)
to crash with the message:

zxdg_decoration_manager_v1@7: error 1: decoration has been already constructed

This extra zxdg_decoration_manager_v1.get_toplevel_decoration() call was
introduced while deprecating wl-shell and xdg-shell-stable[1] support,
and possibly was a bad interaction with [2], which moved the decoration
creation around.

Fixes: 6aae5b44f8 ("Remove wl-shell and xdg-shell-unstable-v6 support (#4323)")

[1]: https://github.com/libsdl-org/SDL/pull/4323
[2]: https://github.com/libsdl-org/SDL/pull/4374
This commit is contained in:
David Gow 2021-07-28 16:54:23 +08:00 committed by Sam Lantinga
parent 7b239edb83
commit 21cba92423
1 changed files with 0 additions and 5 deletions

View File

@ -638,11 +638,6 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window)
xdg_toplevel_add_listener(data->shell_surface.xdg.roleobj.toplevel, &toplevel_listener_xdg, data);
}
/* Create the window decorations */
if (c->decoration_manager) {
data->server_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(c->decoration_manager, data->shell_surface.xdg.roleobj.toplevel);
}
/* Restore state that was set prior to this call */
Wayland_SetWindowTitle(_this, window);
if (window->flags & SDL_WINDOW_MAXIMIZED) {