tablet: store the wheel delta in the normal axes

Now that we don't provide an API anymore to access the absolute value of the
wheel and the axes are handled separately, we can safely store the wheel delta
in the normal axis array.

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-14 16:25:22 +10:00
parent 67220c643f
commit fa71278c19
3 changed files with 6 additions and 9 deletions

View file

@ -293,7 +293,6 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet,
struct libinput_device *base = &device->base;
int a;
double axes[LIBINPUT_TABLET_TOOL_AXIS_MAX + 1] = {0};
double wheel_delta = 0;
int wheel_discrete = 0;
struct device_coords point, old_point;
const struct input_absinfo *absinfo;
@ -390,9 +389,10 @@ tablet_check_notify_axes(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_delta = normalize_wheel(tablet,
tablet->deltas[a]);
axes[a] = 0;
tablet->axes[a] = normalize_wheel(tablet,
tablet->deltas[a]);
} else {
tablet->axes[a] = 0;
}
axes[a] = tablet->axes[a];
@ -426,7 +426,6 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet,
tip_state,
tablet->changed_axes,
axes,
wheel_delta,
wheel_discrete);
}
}

View file

@ -481,7 +481,6 @@ tablet_notify_axis(struct libinput_device *device,
enum libinput_tablet_tool_tip_state tip_state,
unsigned char *changed_axes,
double *axes,
double wheel_delta,
int wheel_discrete);
void

View file

@ -1147,7 +1147,8 @@ libinput_event_tablet_tool_get_wheel_delta(struct libinput_event_tablet_tool *ev
LIBINPUT_EVENT_TABLET_TOOL_TIP,
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
return event->wheel_delta;
return libinput_event_tablet_tool_get_axis_value(event,
LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL);
}
LIBINPUT_EXPORT int
@ -2152,7 +2153,6 @@ tablet_notify_axis(struct libinput_device *device,
enum libinput_tablet_tool_tip_state tip_state,
unsigned char *changed_axes,
double *axes,
double wheel_delta,
int wheel_discrete)
{
struct libinput_event_tablet_tool *axis_event;
@ -2167,7 +2167,6 @@ tablet_notify_axis(struct libinput_device *device,
.proximity_state = LIBINPUT_TABLET_TOOL_PROXIMITY_IN,
.tip_state = tip_state,
.wheel_discrete = wheel_discrete,
.wheel_delta = wheel_delta,
};
memcpy(axis_event->changed_axes,