diff --git a/src/wayland-server.c b/src/wayland-server.c index 97d89182..b19e05bb 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -374,6 +374,12 @@ wl_client_add_resource(struct wl_client *client, wl_signal_init(&resource->destroy_signal); } +WL_EXPORT struct wl_resource * +wl_client_get_object(struct wl_client *client, uint32_t id) +{ + return wl_map_lookup(&client->objects, id); +} + WL_EXPORT void wl_resource_post_no_memory(struct wl_resource *resource) { diff --git a/src/wayland-server.h b/src/wayland-server.h index 249cfa86..6be68976 100644 --- a/src/wayland-server.h +++ b/src/wayland-server.h @@ -118,6 +118,8 @@ struct wl_resource * wl_client_new_object(struct wl_client *client, const struct wl_interface *interface, const void *implementation, void *data); +struct wl_resource * +wl_client_get_object(struct wl_client *client, uint32_t id); struct wl_listener { struct wl_list link;