From 98d702428857c79770b159137835622e33b84ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 4 May 2018 21:50:10 +0200 Subject: [PATCH 1/2] wayland/xdg-foreign: Send immediate destroy event to correct resource The destroyed signal that was emitted if an imported surface was not available when created, for example if the handle was invalid or already unexported, was emitted on the wrong resource. --- src/wayland/meta-wayland-xdg-foreign.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wayland/meta-wayland-xdg-foreign.c b/src/wayland/meta-wayland-xdg-foreign.c index a04b2bfa79b..cecef50a99c 100644 --- a/src/wayland/meta-wayland-xdg-foreign.c +++ b/src/wayland/meta-wayland-xdg-foreign.c @@ -384,7 +384,7 @@ xdg_importer_import (struct wl_client *client, (!META_IS_WAYLAND_XDG_SURFACE (exported->surface->role) && !META_IS_WAYLAND_ZXDG_SURFACE_V6 (exported->surface->role))) { - zxdg_imported_v1_send_destroyed (resource); + zxdg_imported_v1_send_destroyed (xdg_imported_resource); return; } -- GitLab From 332d55f7f6b5d646ea9bc2586b2135113c9d3074 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 2/2] 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 --- 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 cecef50a99c..49ada7ada1d 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) -- GitLab