diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index ffb141c4..83cf433b 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -337,7 +337,7 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet, int a; double axes[LIBINPUT_TABLET_TOOL_AXIS_MAX + 1] = {0}; double deltas[LIBINPUT_TABLET_TOOL_AXIS_MAX + 1] = {0}; - double deltas_discrete[LIBINPUT_TABLET_TOOL_AXIS_MAX + 1] = {0}; + int wheel_discrete = 0; double oldval; struct device_coords point, old_point; const struct input_absinfo *absinfo; @@ -400,7 +400,7 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet, deltas[a] = get_delta(a, tablet->axes[a], oldval); continue; } else if (a == LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL) { - deltas_discrete[a] = tablet->deltas[a]; + wheel_discrete = tablet->deltas[a]; deltas[a] = normalize_wheel(tablet, tablet->deltas[a]); axes[a] = 0; @@ -468,7 +468,7 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet, tablet->changed_axes, axes, deltas, - deltas_discrete); + wheel_discrete); } } diff --git a/src/libinput-private.h b/src/libinput-private.h index 1c8d97ce..b404b0ad 100644 --- a/src/libinput-private.h +++ b/src/libinput-private.h @@ -482,7 +482,7 @@ tablet_notify_axis(struct libinput_device *device, unsigned char *changed_axes, double *axes, double *deltas, - double *deltas_discrete); + int wheel_discrete); void tablet_notify_proximity(struct libinput_device *device, diff --git a/src/libinput.c b/src/libinput.c index b1bced06..e5b21805 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -133,7 +133,7 @@ struct libinput_event_tablet_tool { uint64_t time; double axes[LIBINPUT_TABLET_TOOL_AXIS_MAX + 1]; double deltas[LIBINPUT_TABLET_TOOL_AXIS_MAX + 1]; - double deltas_discrete[LIBINPUT_TABLET_TOOL_AXIS_MAX + 1]; + int wheel_discrete; unsigned char changed_axes[NCHARS(LIBINPUT_TABLET_TOOL_AXIS_MAX + 1)]; struct libinput_tablet_tool *tool; enum libinput_tablet_tool_proximity_state proximity_state; @@ -1161,7 +1161,7 @@ libinput_event_tablet_tool_get_wheel_delta_discrete( LIBINPUT_EVENT_TABLET_TOOL_TIP, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - return event->deltas_discrete[LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL]; + return event->wheel_discrete; } LIBINPUT_EXPORT double @@ -2153,7 +2153,7 @@ tablet_notify_axis(struct libinput_device *device, unsigned char *changed_axes, double *axes, double *deltas, - double *deltas_discrete) + int wheel_discrete) { struct libinput_event_tablet_tool *axis_event; @@ -2166,6 +2166,7 @@ tablet_notify_axis(struct libinput_device *device, .tool = tool, .proximity_state = LIBINPUT_TABLET_TOOL_PROXIMITY_IN, .tip_state = tip_state, + .wheel_discrete = wheel_discrete, }; memcpy(axis_event->changed_axes, @@ -2173,9 +2174,6 @@ tablet_notify_axis(struct libinput_device *device, sizeof(axis_event->changed_axes)); memcpy(axis_event->axes, axes, sizeof(axis_event->axes)); memcpy(axis_event->deltas, deltas, sizeof(axis_event->deltas)); - memcpy(axis_event->deltas_discrete, - deltas_discrete, - sizeof(axis_event->deltas_discrete)); post_device_event(device, time,