Regarding user data for wl_client.

Giulio Camuffo giuliocamuffo at gmail.com
Wed Jan 27 02:14:34 PST 2016


2016-01-27 5:30 GMT+02:00  <nicesj at nicesj.com>:
> Dear all,
>
> Currently, I'm writing a simple compositor for proving my thought.
>
> while implementing it, I found that the wl_client doesn't have the user data
> field.
>
> in the sever side, the wl_client is used in many callbacks for handling the
> request of clients.
>
> are there any functions like wl_client_set_user_data, get_user_data?

As Pekka said they are missing as of now, however there is a workaround: have a

struct my_client {
  wl_listener destroy_listener;
  ...
};

and set the listener on the wl_client with
wl_client_add_destroy_listener(wl_client,
&my_client.destroy_listener), you can then retrieve the my_client from
the wl_client by doing

struct wl_listener *l = wl_client_get_destroy_listener(wl_client, ...);
struct my_client *c = container_of(l, struct my_client, destroy_listener);


--
Giulio


>
> Best regards,
> Sungjae Park
>
>
> Sent from my android device.
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>


More information about the wayland-devel mailing list