[PATCH libinput 4/7] tablet: drop delta array, provided by the tablet_axis struct now

Peter Hutterer peter.hutterer at who-t.net
Thu Jan 14 16:26:38 PST 2016


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-tablet.c | 7 +++----
 src/evdev-tablet.h | 1 -
 src/libinput.c     | 2 --
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index 29c86ad..1870e7e 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -430,9 +430,9 @@ tablet_handle_wheel(struct tablet_dispatch *tablet,
 
 	a = LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL;
 	if (bit_is_set(tablet->changed_axes, a)) {
-		*wheel_discrete = tablet->deltas[a];
+		*wheel_discrete = tablet->axes.wheel_discrete;
 		tablet->axes.wheel = normalize_wheel(tablet,
-						     tablet->deltas[a]);
+						     tablet->axes.wheel_discrete);
 	} else {
 		tablet->axes.wheel = 0;
 		*wheel_discrete = 0;
@@ -457,7 +457,6 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet,
 	axes.pressure = tablet_handle_pressure(tablet, device, tool);
 	axes.distance = tablet_handle_distance(tablet, device);
 	axes.slider = tablet_handle_slider(tablet, device);
-
 	axes.tilt = tablet_handle_tilt(tablet, device);
 
 	/* We must check ROTATION_Z after TILT_X/Y so that the tilt axes are
@@ -602,7 +601,7 @@ tablet_process_relative(struct tablet_dispatch *tablet,
 			break;
 		}
 		set_bit(tablet->changed_axes, axis);
-		tablet->deltas[axis] = -1 * e->value;
+		tablet->axes.wheel_discrete = -1 * e->value;
 		tablet_set_status(tablet, TABLET_AXES_UPDATED);
 		break;
 	default:
diff --git a/src/evdev-tablet.h b/src/evdev-tablet.h
index 4d359bb..1d6fc93 100644
--- a/src/evdev-tablet.h
+++ b/src/evdev-tablet.h
@@ -54,7 +54,6 @@ struct tablet_dispatch {
 	unsigned int status;
 	unsigned char changed_axes[NCHARS(LIBINPUT_TABLET_TOOL_AXIS_MAX + 1)];
 	struct tablet_axes axes;
-	double deltas[LIBINPUT_TABLET_TOOL_AXIS_MAX + 1];
 	unsigned char axis_caps[NCHARS(LIBINPUT_TABLET_TOOL_AXIS_MAX + 1)];
 
 	/* Only used for tablets that don't report serial numbers */
diff --git a/src/libinput.c b/src/libinput.c
index 7beb8b7..2f80f03 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -2240,8 +2240,6 @@ tablet_notify_proximity(struct libinput_device *device,
 	       changed_axes,
 	       sizeof(proximity_event->changed_axes));
 
-	/* deltas are always 0 on prox-in/out */
-
 	post_device_event(device,
 			  time,
 			  LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY,
-- 
2.5.0



More information about the wayland-devel mailing list