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

Peter Hutterer peter.hutterer at who-t.net
Wed Dec 2 17:04:46 PST 2015


On Wed, Dec 02, 2015 at 10:22:56AM +0100, Hans de Goede wrote:
> 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>

whoops, thanks. I had to also modify the condition to 
if (distance &&
    ....

since some tablets don't have distance, which was previously papered over by
the changed_axis bit never being set.

thanks for the review

Cheers,
   Peter

> 
> >  	    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