wayland/surface: The same sub-surface is not a valid sibling

The Wayland protocol documentation at
https://wayland.app/protocols/wayland#wl_subsurface:request:place_above
says:

 The reference surface must be one of the sibling surfaces, or the
 parent surface. Using any other surface, including this sub-surface,
 will cause a protocol error.

v2:
* Leave it as a single line. (Georges Basile Stavracas Neto)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2525>
This commit is contained in:
Michel Dänzer 2022-06-17 16:33:17 +02:00 committed by Michel Dänzer
parent ddb7f84291
commit 709d06e89e

View File

@ -102,7 +102,7 @@ static gboolean
is_sibling (MetaWaylandSurface *surface,
MetaWaylandSurface *sibling)
{
return surface->sub.parent == sibling->sub.parent;
return surface != sibling && surface->sub.parent == sibling->sub.parent;
}
static gboolean