[PATCH libinput 5/9] tablet: simplify check for testing if an axis update is needed

Peter Hutterer peter.hutterer at who-t.net
Sun Dec 20 21:57:01 PST 2015


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

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-tablet.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index a46a972..56ade1c 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -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 */
-- 
2.5.0



More information about the wayland-devel mailing list