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

Peter Hutterer peter.hutterer at who-t.net
Tue Dec 1 17:46:27 PST 2015


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)) &&
 	    distance->value > distance->minimum &&
 	    pressure->value > pressure->minimum) {
 		clear_bit(tablet->changed_axes, LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
-- 
2.5.0



More information about the wayland-devel mailing list