[PATCH v2 libinput 05.5/10] touchpad: use the evdev device's filter struct

Hans de Goede hdegoede at redhat.com
Mon Sep 22 00:27:38 PDT 2014


Hi,

On 09/22/2014 02:01 AM, Peter Hutterer wrote:
> We don't need a separate filter struct, we can use the parent evdev device.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Looks good:

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans

> ---
> Changes to v1:
> - didn't exist in the first set of patches, slots in after 05/10
> - prep work for having the same code for pointer accel functions
> 
>  src/evdev-mt-touchpad.c | 5 ++---
>  src/evdev-mt-touchpad.h | 2 --
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
> index 0b51809..79f5357 100644
> --- a/src/evdev-mt-touchpad.c
> +++ b/src/evdev-mt-touchpad.c
> @@ -65,7 +65,7 @@ tp_filter_motion(struct tp_dispatch *tp,
>  	motion.dy = *dy * tp->accel.y_scale_coeff;
>  
>  	if (motion.dx != 0.0 || motion.dy != 0.0)
> -		filter_dispatch(tp->filter, &motion, tp, time);
> +		filter_dispatch(tp->device->pointer.filter, &motion, tp, time);
>  
>  	*dx = motion.dx;
>  	*dy = motion.dy;
> @@ -602,7 +602,6 @@ tp_destroy(struct evdev_dispatch *dispatch)
>  	tp_destroy_tap(tp);
>  	tp_destroy_buttons(tp);
>  
> -	filter_destroy(tp->filter);
>  	free(tp->touches);
>  	free(tp);
>  }
> @@ -845,7 +844,7 @@ tp_init_accel(struct tp_dispatch *tp, double diagonal)
>  	if (accel == NULL)
>  		return -1;
>  
> -	tp->filter = accel;
> +	tp->device->pointer.filter = accel;
>  
>  	return 0;
>  }
> diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h
> index 3d3932b..73d0c91 100644
> --- a/src/evdev-mt-touchpad.h
> +++ b/src/evdev-mt-touchpad.h
> @@ -167,8 +167,6 @@ struct tp_dispatch {
>  		int32_t margin_y;
>  	} hysteresis;
>  
> -	struct motion_filter *filter;
> -
>  	struct {
>  		double x_scale_coeff;
>  		double y_scale_coeff;
> 


More information about the wayland-devel mailing list