diff options
-rw-r--r-- | src/evdev-fallback.c | 9 | ||||
-rw-r--r-- | src/evdev-fallback.h | 4 | ||||
-rw-r--r-- | src/evdev-wheel.c | 15 |
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; |