From 889c56c776520c1bf430cc13cd87da2ab78d6161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 4 May 2018 21:52:45 +0200 Subject: [PATCH] wayland/xdg-foreign: Fix child surface validation check The role type should be either an xdg-shell toplevel, or a xdg-shell unstable v6 toplevel. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/138 (cherry picked from commit 332d55f7f6b5d646ea9bc2586b2135113c9d3074) --- src/wayland/meta-wayland-xdg-foreign.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/wayland/meta-wayland-xdg-foreign.c b/src/wayland/meta-wayland-xdg-foreign.c index cecef50a9..49ada7ada 100644 --- a/src/wayland/meta-wayland-xdg-foreign.c +++ b/src/wayland/meta-wayland-xdg-foreign.c @@ -252,10 +252,8 @@ is_valid_child (MetaWaylandSurface *surface) if (!surface->role) return FALSE; - if (!META_IS_WAYLAND_XDG_SURFACE (surface->role)) - return FALSE; - - if (!META_IS_WAYLAND_ZXDG_SURFACE_V6 (surface->role)) + if (!META_IS_WAYLAND_XDG_TOPLEVEL (surface->role) && + !META_IS_WAYLAND_ZXDG_TOPLEVEL_V6 (surface->role)) return FALSE; if (!surface->window)