[PATCH weston v4 10/20] input: Provide microsecond timestamps in motion events
Peter Hutterer
peter.hutterer at who-t.net
Wed Nov 18 18:23:39 PST 2015
On Tue, Nov 17, 2015 at 06:10:56PM +0800, Jonas Ådahl wrote:
> Provide timestamps with microsecond granularity if the backend can
> provide it. Backends that can't should set it to 0.
>
> Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> src/compositor.h | 1 +
> src/libinput-device.c | 3 +++
> 2 files changed, 4 insertions(+)
>
> diff --git a/src/compositor.h b/src/compositor.h
> index 1f5d89b..bd0d134 100644
> --- a/src/compositor.h
> +++ b/src/compositor.h
> @@ -248,6 +248,7 @@ enum weston_pointer_motion_mask {
>
> struct weston_pointer_motion_event {
> uint32_t mask;
> + uint64_t time_usec;
> double x;
> double y;
> double dx;
> diff --git a/src/libinput-device.c b/src/libinput-device.c
> index f60d1e0..918541c 100644
> --- a/src/libinput-device.c
> +++ b/src/libinput-device.c
> @@ -87,6 +87,8 @@ handle_pointer_motion(struct libinput_device *libinput_device,
> struct evdev_device *device =
> libinput_device_get_user_data(libinput_device);
> struct weston_pointer_motion_event event = { 0 };
> + uint64_t time_usec =
> + libinput_event_pointer_get_time_usec(pointer_event);
> double dx_unaccel, dy_unaccel;
>
> dx_unaccel = libinput_event_pointer_get_dx_unaccelerated(pointer_event);
> @@ -95,6 +97,7 @@ handle_pointer_motion(struct libinput_device *libinput_device,
> event = (struct weston_pointer_motion_event) {
> .mask = WESTON_POINTER_MOTION_REL |
> WESTON_POINTER_MOTION_REL_UNACCEL,
> + .time_usec = time_usec,
> .dx = libinput_event_pointer_get_dx(pointer_event),
> .dy = libinput_event_pointer_get_dy(pointer_event),
> .dx_unaccel = dx_unaccel,
> --
> 2.4.3
>
> _______________________________________________
> 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