[client] wayland: fix double xdg_toplevel role assignment in libdecor path
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled

libdecor_decorate() already creates an xdg_surface and xdg_toplevel
internally for the frame. Calling xdg_surface_get_toplevel() again on
that same xdg_surface just to fetch the toplevel for icon handling
assigns the xdg_toplevel role to the underlying wl_surface a second
time, which is a protocol violation.

On GNOME Shell 50 (mutter) this is no longer tolerated: mutter
terminates the Wayland connection ("WL: error in client
communication"), and since libdecor_shellInit() waits for the initial
configure with a blocking, error-less libdecor_dispatch(-1) loop, the
client hangs forever with no window and no diagnostic output. This
made -DENABLE_LIBDECOR=ON (the default when libdecor-0 is present)
appear completely broken on current GNOME/Wayland.

Use libdecor_frame_get_xdg_toplevel() instead, which returns the
xdg_toplevel libdecor already owns, without requesting a second role
assignment.

Require libdecor-0 >= 0.1.1, which is available in Debian oldstable,
so the new accessor is guaranteed by the build dependency.
This commit is contained in:
Amit Mendapara
2026-08-03 14:54:59 +05:30
committed by Geoffrey McRae
parent e671bfd4e7
commit 3035fa6282
3 changed files with 3 additions and 4 deletions

View File

@@ -75,3 +75,4 @@ Jérôme Poulin <jeromepoulin@gmail.com> (ticpu)
Marco Rodolfi <marco.rodolfi@tuta.io> (RodoMa92)
Stewart Borle <stewi1014@gmail.com> (stewi1014)
Jannis Lübke <business.janrupf@gmail.com> (Janrupf)
Amit Mendapara <282290+cristatus@users.noreply.github.com> (cristatus)