From 419fb81d401408084858a62767409baca17fd1c4 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 12 Mar 2018 17:08:18 +0100 Subject: [PATCH] wayland: Fix wrong condition in xdg_exporter.export Commit d714a94d9 added support for stable xdg-shell surfaces while preserving old unstable zxdg-shell v6 ones, but committed a mistake in checking for both in the xdg_exporter.export error condition paths. We want to check that the surface is neither of both. https://gitlab.gnome.org/GNOME/mutter/issues/63 Closes: #63 --- src/wayland/meta-wayland-xdg-foreign.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/wayland/meta-wayland-xdg-foreign.c b/src/wayland/meta-wayland-xdg-foreign.c index cfeb81738..a04b2bfa7 100644 --- a/src/wayland/meta-wayland-xdg-foreign.c +++ b/src/wayland/meta-wayland-xdg-foreign.c @@ -144,10 +144,9 @@ xdg_exporter_export (struct wl_client *client, MetaWaylandXdgExported *exported; char *handle; - if (!surface->role || - !META_IS_WAYLAND_XDG_SURFACE (surface->role) || - !META_IS_WAYLAND_ZXDG_SURFACE_V6 (surface->role) || - !surface->window) + if (!surface->role || !surface->window || + !(META_IS_WAYLAND_XDG_SURFACE (surface->role) || + META_IS_WAYLAND_ZXDG_SURFACE_V6 (surface->role))) { wl_resource_post_error (resource, WL_DISPLAY_ERROR_INVALID_OBJECT,