diff options
author | Jonas Ã…dahl <jadahl@gmail.com> | 2023-01-27 15:13:58 +0100 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2023-02-13 15:34:24 +0000 |
commit | 63c8c229d625fdbc847356351b64f7e908eea676 (patch) | |
tree | 0a5168295feeda411fa9159678d3ba597adf228b /src | |
parent | 71e0bc0cbf721fc37e186f0f842cefc4eb6b7ad1 (diff) | |
download | mutter-63c8c229d625fdbc847356351b64f7e908eea676.tar.gz |
wayland/client: Add API to check if it matches a wl_client
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
Diffstat (limited to 'src')
-rw-r--r-- | src/wayland/meta-wayland-client-private.h | 6 | ||||
-rw-r--r-- | src/wayland/meta-wayland-client.c | 10 |
2 files changed, 16 insertions, 0 deletions
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 <wayland-server-core.h> + #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; +} |