wayland/client: Add API to check if it matches a wl_client

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
This commit is contained in:
Jonas Ådahl 2023-01-27 15:13:58 +01:00 committed by Marge Bot
parent 71e0bc0cbf
commit 63c8c229d6
2 changed files with 16 additions and 0 deletions

View File

@ -20,6 +20,8 @@
#ifndef META_WAYLAND_CLIENT_PRIVATE_H #ifndef META_WAYLAND_CLIENT_PRIVATE_H
#define META_WAYLAND_CLIENT_PRIVATE_H #define META_WAYLAND_CLIENT_PRIVATE_H
#include <wayland-server-core.h>
#include "core/util-private.h" #include "core/util-private.h"
#include "meta/meta-wayland-client.h" #include "meta/meta-wayland-client.h"
@ -31,4 +33,8 @@ META_EXPORT_TEST
int meta_wayland_client_setup_fd (MetaWaylandClient *client, int meta_wayland_client_setup_fd (MetaWaylandClient *client,
GError **error); GError **error);
META_EXPORT_TEST
gboolean meta_wayland_client_matches (MetaWaylandClient *client,
const struct wl_client *wayland_client);
#endif /* META_WAYLAND_CLIENT_PRIVATE_H */ #endif /* META_WAYLAND_CLIENT_PRIVATE_H */

View File

@ -473,3 +473,13 @@ meta_wayland_client_show_in_window_list (MetaWaylandClient *client,
meta_window_recalc_features (window); 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;
}