diff --git a/data/dbus-interfaces/org.gnome.Mutter.ServiceChannel.xml b/data/dbus-interfaces/org.gnome.Mutter.ServiceChannel.xml index 3717827f3..1c105cd35 100644 --- a/data/dbus-interfaces/org.gnome.Mutter.ServiceChannel.xml +++ b/data/dbus-interfaces/org.gnome.Mutter.ServiceChannel.xml @@ -8,6 +8,7 @@ diff --git a/src/core/meta-service-channel.c b/src/core/meta-service-channel.c index a60026741..8211546b7 100644 --- a/src/core/meta-service-channel.c +++ b/src/core/meta-service-channel.c @@ -98,6 +98,7 @@ verify_service_client_type (uint32_t service_client_type) case META_SERVICE_CLIENT_TYPE_NONE: return FALSE; case META_SERVICE_CLIENT_TYPE_PORTAL_BACKEND: + case META_SERVICE_CLIENT_TYPE_FILECHOOSER_PORTAL_BACKEND: return TRUE; } diff --git a/src/core/meta-service-channel.h b/src/core/meta-service-channel.h index 8afbcd331..cee31add3 100644 --- a/src/core/meta-service-channel.h +++ b/src/core/meta-service-channel.h @@ -30,6 +30,7 @@ typedef enum _MetaServiceClientType { META_SERVICE_CLIENT_TYPE_NONE, META_SERVICE_CLIENT_TYPE_PORTAL_BACKEND, + META_SERVICE_CLIENT_TYPE_FILECHOOSER_PORTAL_BACKEND, } MetaServiceClientType; #define META_TYPE_SERVICE_CHANNEL (meta_service_channel_get_type ()) diff --git a/src/wayland/meta-wayland-x11-interop.c b/src/wayland/meta-wayland-x11-interop.c index 506adc448..b39fd386a 100644 --- a/src/wayland/meta-wayland-x11-interop.c +++ b/src/wayland/meta-wayland-x11-interop.c @@ -101,13 +101,17 @@ x11_interop_filter (const struct wl_client *client, service_client = meta_service_channel_get_service_client (service_channel, META_SERVICE_CLIENT_TYPE_PORTAL_BACKEND); - if (!service_client) - return META_WAYLAND_ACCESS_DENIED; - if (meta_wayland_client_matches (service_client, client)) + if (service_client && meta_wayland_client_matches (service_client, client)) return META_WAYLAND_ACCESS_ALLOWED; - else - return META_WAYLAND_ACCESS_DENIED; + + service_client = + meta_service_channel_get_service_client (service_channel, + META_SERVICE_CLIENT_TYPE_FILECHOOSER_PORTAL_BACKEND); + if (service_client && meta_wayland_client_matches (service_client, client)) + return META_WAYLAND_ACCESS_ALLOWED; + + return META_WAYLAND_ACCESS_DENIED; } void