[PATCH weston 5/6] libweston: Implement pointer timestamps for input_timestamps_unstable_v1

Pekka Paalanen ppaalanen at gmail.com
Fri Jan 19 09:56:47 UTC 2018


On Wed, 20 Dec 2017 16:18:00 +0200
Alexandros Frantzis <alexandros.frantzis at collabora.com> wrote:

> Implement the zwp_input_timestamps_v1.get_pointer_timestamps request to
> subscribe to timestamp events for wl_pointer resources.
> 
> Signed-off-by: Alexandros Frantzis <alexandros.frantzis at collabora.com>
> ---
>  libweston/compositor.h |  2 ++
>  libweston/input.c      | 50 +++++++++++++++++++++++++++++++++-----
>  tests/pointer-test.c   | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 112 insertions(+), 6 deletions(-)
> 
> diff --git a/libweston/compositor.h b/libweston/compositor.h
> index 85f59d45..7fa88800 100644
> --- a/libweston/compositor.h
> +++ b/libweston/compositor.h
> @@ -391,6 +391,8 @@ struct weston_pointer {
>  	uint32_t button_count;
>  
>  	struct wl_listener output_destroy_listener;
> +
> +	struct wl_list timestamps_list;
>  };
>  
>  
> diff --git a/libweston/input.c b/libweston/input.c
> index 8a27fc08..9aceccb1 100644
> --- a/libweston/input.c
> +++ b/libweston/input.c
> @@ -205,12 +205,14 @@ unbind_pointer_client_resource(struct wl_resource *resource)
>  {
>  	struct weston_pointer *pointer = wl_resource_get_user_data(resource);
>  	struct wl_client *client = wl_resource_get_client(resource);
> +	struct wl_list *timestamps_list = &pointer->timestamps_list;
>  	struct weston_pointer_client *pointer_client;
>  
>  	pointer_client = weston_pointer_get_pointer_client(pointer, client);
>  	assert(pointer_client);
>  
>  	wl_list_remove(wl_resource_get_link(resource));
> +	remove_input_resource_from_timestamps(resource, timestamps_list);
>  	weston_pointer_cleanup_pointer_client(pointer, pointer_client);
>  }
>  
> @@ -407,6 +409,9 @@ pointer_send_relative_motion(struct weston_pointer *pointer,
>  	dyf_unaccel = wl_fixed_from_double(dy_unaccel);
>  
>  	wl_resource_for_each(resource, resource_list) {
> +		send_timestamps_for_input_resource(resource,
> +                                                   &pointer->timestamps_list,
> +                                                   time);
>  		zwp_relative_pointer_v1_send_relative_motion(

This is not a wl_pointer event, so I believe it should not be
accompanied with a timestamp event.

With that hunk removed:

Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


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/01843dea/attachment.sig>


More information about the wayland-devel mailing list