[PATCH libinput 3/8] tablet: drop pressure when either pressure or distance changed

Hans de Goede hdegoede at redhat.com
Wed Dec 2 01:22:56 PST 2015


Hi,

On 02-12-15 02:46, Peter Hutterer wrote:
> Keep pressure and distance mutually exclusive regardless which one of the two
> updates.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>   src/evdev-tablet.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
> index 82029a9..395cbef 100644
> --- a/src/evdev-tablet.c
> +++ b/src/evdev-tablet.c
> @@ -853,7 +853,8 @@ sanitize_tablet_axes(struct tablet_dispatch *tablet)
>   	pressure = libevdev_get_abs_info(tablet->device->evdev, ABS_PRESSURE);
>
>   	/* Keep distance and pressure mutually exclusive */
> -	if (bit_is_set(tablet->changed_axes, LIBINPUT_TABLET_TOOL_AXIS_DISTANCE) &&
> +	if ((bit_is_set(tablet->changed_axes, LIBINPUT_TABLET_TOOL_AXIS_DISTANCE) ||
> +	     bit_is_set(tablet->changed_axes, LIBINPUT_TABLET_TOOL_AXIS_DISTANCE)) &&

Your checking the same bit twice here, I believe you need to s/DISTANCE/PRESSURE/
in the second check.

The rest of the series looks good, so the series, and this one with this fixed is:

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

Regards,

Hans


>   	    distance->value > distance->minimum &&
>   	    pressure->value > pressure->minimum) {
>   		clear_bit(tablet->changed_axes, LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
>


More information about the wayland-devel mailing list