summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2022-09-05 09:26:21 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2022-09-08 09:03:15 +1000
commitf87fffd1937062d8e67ec77ff86f7b2b1495027a (patch)
tree65aff379f12be2a19c357ee180b119e4cbb928e4
parentf80b142dc3c06f65abd43e4df3000b24c6eec2b3 (diff)
downloadlibinput-f87fffd1937062d8e67ec77ff86f7b2b1495027a.tar.gz
evdev: use filter_dispatch_constant() for the lenovo trackpoint "wheel"
Rather than normalizing manually, leave this up to the pointer acceleration code. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev-fallback.c9
-rw-r--r--src/evdev-fallback.h4
-rw-r--r--src/evdev-wheel.c15
3 files changed, 10 insertions, 18 deletions
diff --git a/src/evdev-fallback.c b/src/evdev-fallback.c
index bd5a458c..4dcccf3b 100644
--- a/src/evdev-fallback.c
+++ b/src/evdev-fallback.c
@@ -90,15 +90,6 @@ fallback_interface_get_switch_state(struct evdev_dispatch *evdev_dispatch,
LIBINPUT_SWITCH_STATE_OFF;
}
-void
-fallback_normalize_delta(struct evdev_device *device,
- const struct device_coords *delta,
- struct normalized_coords *normalized)
-{
- normalized->x = delta->x * DEFAULT_MOUSE_DPI / (double)device->dpi;
- normalized->y = delta->y * DEFAULT_MOUSE_DPI / (double)device->dpi;
-}
-
static inline bool
post_button_scroll(struct evdev_device *device,
struct device_float_coords raw,
diff --git a/src/evdev-fallback.h b/src/evdev-fallback.h
index 48be42a1..27533a1a 100644
--- a/src/evdev-fallback.h
+++ b/src/evdev-fallback.h
@@ -270,10 +270,6 @@ fallback_notify_physical_button(struct fallback_dispatch *dispatch,
uint64_t time,
int button,
enum libinput_button_state state);
-void
-fallback_normalize_delta(struct evdev_device *device,
- const struct device_coords *delta,
- struct normalized_coords *normalized);
void
fallback_init_wheel(struct fallback_dispatch *dispatch,
diff --git a/src/evdev-wheel.c b/src/evdev-wheel.c
index 7fcf658d..7276ec1a 100644
--- a/src/evdev-wheel.c
+++ b/src/evdev-wheel.c
@@ -191,14 +191,19 @@ wheel_flush_scroll(struct fallback_dispatch *dispatch,
* trackstick data via REL_WHEEL. Normalize it like normal x/y coordinates.
*/
if (device->model_flags & EVDEV_MODEL_LENOVO_SCROLLPOINT) {
- struct normalized_coords unaccel = { 0.0, 0.0 };
-
- dispatch->wheel.lo_res.y *= -1;
- fallback_normalize_delta(device, &dispatch->wheel.lo_res, &unaccel);
+ const struct device_float_coords raw = {
+ .x = dispatch->wheel.lo_res.x,
+ .y = dispatch->wheel.lo_res.y * -1,
+ };
+ const struct normalized_coords normalized =
+ filter_dispatch_constant(device->pointer.filter,
+ &raw,
+ device,
+ time);
evdev_post_scroll(device,
time,
LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS,
- &unaccel);
+ &normalized);
dispatch->wheel.hi_res.x = 0;
dispatch->wheel.hi_res.y = 0;
dispatch->wheel.lo_res.x = 0;