tablet: drop pressure when either pressure or distance changed

Keep pressure and distance mutually exclusive regardless which one of the two
updates.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Peter Hutterer 2015-11-30 15:00:43 +10:00
parent d749170450
commit 319fb38ded

View file

@ -853,7 +853,9 @@ 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 (distance &&
(bit_is_set(tablet->changed_axes, LIBINPUT_TABLET_TOOL_AXIS_DISTANCE) ||
bit_is_set(tablet->changed_axes, LIBINPUT_TABLET_TOOL_AXIS_PRESSURE)) &&
distance->value > distance->minimum &&
pressure->value > pressure->minimum) {
clear_bit(tablet->changed_axes, LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);