Add a resource creation signal

This change allows to add a resource creation listener to a wl_client,
which will be notified when a new resource is created for that client.
The alternative would be to have a per wl_display listener, but i think
that resources are really client specific objects, so it makes sense
to use the wl_client as the context.

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
[Pekka: added wl_list_remove() in TEST(new_resource).]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Giulio Camuffo 2016-08-11 17:23:09 +02:00 committed by Pekka Paalanen
parent 596024f728
commit c55c1d787c
3 changed files with 110 additions and 10 deletions

View file

@ -212,6 +212,10 @@ wl_client_get_object(struct wl_client *client, uint32_t id);
void
wl_client_post_no_memory(struct wl_client *client);
void
wl_client_add_resource_created_listener(struct wl_client *client,
struct wl_listener *listener);
/** \class wl_listener
*
* \brief A single listener for Wayland signals