From 63c8c229d625fdbc847356351b64f7e908eea676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 27 Jan 2023 15:13:58 +0100 Subject: [PATCH] wayland/client: Add API to check if it matches a wl_client Part-of: --- src/wayland/meta-wayland-client-private.h | 6 ++++++ src/wayland/meta-wayland-client.c | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/wayland/meta-wayland-client-private.h b/src/wayland/meta-wayland-client-private.h index 0f67a2e66..c1524dead 100644 --- a/src/wayland/meta-wayland-client-private.h +++ b/src/wayland/meta-wayland-client-private.h @@ -20,6 +20,8 @@ #ifndef META_WAYLAND_CLIENT_PRIVATE_H #define META_WAYLAND_CLIENT_PRIVATE_H +#include + #include "core/util-private.h" #include "meta/meta-wayland-client.h" @@ -31,4 +33,8 @@ META_EXPORT_TEST int meta_wayland_client_setup_fd (MetaWaylandClient *client, GError **error); +META_EXPORT_TEST +gboolean meta_wayland_client_matches (MetaWaylandClient *client, + const struct wl_client *wayland_client); + #endif /* META_WAYLAND_CLIENT_PRIVATE_H */ diff --git a/src/wayland/meta-wayland-client.c b/src/wayland/meta-wayland-client.c index 56d8f4bcc..f7e1ff20c 100644 --- a/src/wayland/meta-wayland-client.c +++ b/src/wayland/meta-wayland-client.c @@ -473,3 +473,13 @@ meta_wayland_client_show_in_window_list (MetaWaylandClient *client, meta_window_recalc_features (window); } } + +gboolean +meta_wayland_client_matches (MetaWaylandClient *client, + const struct wl_client *wayland_client) +{ + g_return_val_if_fail (wayland_client, FALSE); + g_return_val_if_fail (client->wayland_client, FALSE); + + return client->wayland_client == wayland_client; +}