tablet: Clear pressure axis when tool loses contact with the tablet

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Stephen Chandler Paul 2014-06-17 21:17:58 -04:00 committed by Peter Hutterer
parent 8f9730872d
commit 563268fa9f

View file

@ -343,7 +343,12 @@ sanitize_tablet_axes(struct tablet_dispatch *tablet)
tablet->axes[LIBINPUT_TABLET_AXIS_DISTANCE] = 0;
} else if (bit_is_set(tablet->changed_axes, LIBINPUT_TABLET_AXIS_PRESSURE) &&
!tablet_has_status(tablet, TABLET_STYLUS_IN_CONTACT)) {
clear_bit(tablet->changed_axes, LIBINPUT_TABLET_AXIS_PRESSURE);
/* Make sure that the last axis value sent to the caller is a 0 */
if (tablet->axes[LIBINPUT_TABLET_AXIS_PRESSURE] == 0)
clear_bit(tablet->changed_axes,
LIBINPUT_TABLET_AXIS_PRESSURE);
else
tablet->axes[LIBINPUT_TABLET_AXIS_PRESSURE] = 0;
}
}