tablet: simplify check for testing if an axis update is needed

We know when one of the bits is set we need to send an event

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-12-21 14:56:41 +10:00
parent c8a99cdf10
commit 67220c643f

View file

@ -291,7 +291,6 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet,
struct libinput_tablet_tool *tool)
{
struct libinput_device *base = &device->base;
bool axis_update_needed = false;
int a;
double axes[LIBINPUT_TABLET_TOOL_AXIS_MAX + 1] = {0};
double wheel_delta = 0;
@ -300,10 +299,7 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet,
const struct input_absinfo *absinfo;
const char tmp[sizeof(tablet->changed_axes)] = {0};
if (memcmp(tmp, tablet->changed_axes, sizeof(tmp)))
axis_update_needed = true;
if (!axis_update_needed)
if (memcmp(tmp, tablet->changed_axes, sizeof(tmp)) == 0)
return;
/* x/y are special for left-handed and calibration */