mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-11 00:30:19 +01:00
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>
This commit is contained in:
parent
f80b142dc3
commit
f87fffd193
3 changed files with 10 additions and 18 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue