[PATCH weston 2/3] input: Provide microsecond timestamps in motion events

Jonas Ådahl jadahl at gmail.com
Wed Sep 2 19:12:24 PDT 2015


On Wed, Sep 02, 2015 at 01:20:34PM -0500, Derek Foreman wrote:
> On 29/07/15 01:39 AM, 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>
> > ---
> > 
> > This requires libinput master branch. I didn't add any dependency
> > checking since libinput hasn't been released with the new _get_time_usec
> > functions, but I doubt this will be merged before that so we can just fix
> > this patch after the next libinput version is released.
> 
> Has this functionality landed in a libinput release now?

Yes, it is available in the 0.21 release from last month.

> 
> Can we update the libinput requirement in the build stuff along with this?
> 
> If you can update this to make any build failures happen in configure
> instead of at build time, this is:
> Reviewed-by: Derek Foreman <derekf at osg.samsung.com>

Thanks

Jonas

> 
> > 
> > 
> >  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 4d5b0e1..20c1dd3 100644
> > --- a/src/compositor.h
> > +++ b/src/compositor.h
> > @@ -247,6 +247,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 78133f2..eae6f0c 100644
> > --- a/src/libinput-device.c
> > +++ b/src/libinput-device.c
> > @@ -89,6 +89,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);
> > @@ -97,6 +99,7 @@ handle_pointer_motion(struct libinput_device *libinput_device,
> >  	event = (struct weston_pointer_motion_event) {
> >  		.mask = WESTON_POINTER_MOTION_REL |
> >  			WESTON_POINTER_MOTION_REL_NOACCEL,
> > +		.time_usec = time_usec,
> >  		.dx = libinput_event_pointer_get_dx(pointer_event),
> >  		.dy = libinput_event_pointer_get_dy(pointer_event),
> >  		.dx_unaccel = dx_unaccel,
> > 
> 


More information about the wayland-devel mailing list