[PATCH weston 6/6] libweston: Implement touch timestamps for input_timestamps_unstable_v1
Pekka Paalanen
ppaalanen at gmail.com
Fri Jan 19 10:18:38 UTC 2018
On Wed, 20 Dec 2017 16:18:01 +0200
Alexandros Frantzis <alexandros.frantzis at collabora.com> wrote:
> Implement the zwp_input_timestamps_v1.get_touch_timestamps request to
> subscribe to timestamp events for wl_touch resources.
>
> Signed-off-by: Alexandros Frantzis <alexandros.frantzis at collabora.com>
> ---
> libweston/compositor.h | 2 ++
> libweston/input.c | 53 +++++++++++++++++++++++++++++++++++++++++++-------
> tests/touch-test.c | 46 +++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 94 insertions(+), 7 deletions(-)
> @@ -4643,7 +4665,24 @@ input_timestamps_manager_get_touch_timestamps(struct wl_client *client,
> uint32_t id,
> struct wl_resource *touch_resource)
> {
> - wl_client_post_no_memory(client);
> + struct weston_seat *seat = wl_resource_get_user_data(touch_resource);
> + struct wl_resource *input_ts;
> +
> + input_ts = wl_resource_create(client,
> + &zwp_input_timestamps_v1_interface,
> + 1, id);
> + if (!input_ts) {
> + wl_client_post_no_memory(client);
> + return;
> + }
> +
> + wl_resource_set_implementation(input_ts,
> + &input_timestamps_interface,
> + touch_resource,
> + unbind_resource);
> +
> + wl_list_insert(&seat->touch_state->timestamps_list,
> + wl_resource_get_link(input_ts));
Btw. each of the three patches adds a new list to weston_keyboard,
weston_pointer, weston_touch, but following the example already set in
the code, do not handle that struct getting destroyed while client
resources for it still exist. This would be good to fix, at least for
the new lists introduced in these patches. I only realized that after
sending the earlier R-bs.
You can find the places with:
$ git grep -p 'XXX: What about'
Otherwise the patch looks good, tests included. Nice work with the
series.
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180119/17af732e/attachment.sig>
More information about the wayland-devel
mailing list