filter: don't normalize the speed again in the default mouse filter

The first thing this filter does is normalize the coordinates to
1000dpi, i.e. all other values are in normalized coordinates.

By normalizing the speed again we get an invalid value, effectively
stretching or compressing the acceleration curve. e.g. on a 5000dpi
mouse the estimated speed was 1/5 of the real speed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2022-09-05 09:46:54 +10:00
parent f87fffd193
commit 49707691c8

View file

@ -196,7 +196,7 @@ accelerator_set_speed(struct motion_filter *filter,
double
pointer_accel_profile_linear(struct motion_filter *filter,
void *data,
double speed_in, /* in device units (units/µs) */
double speed_in, /* in normalized units */
uint64_t time)
{
struct pointer_accelerator *accel_filter =
@ -206,9 +206,6 @@ pointer_accel_profile_linear(struct motion_filter *filter,
const double incline = accel_filter->incline;
double factor; /* unitless */
/* Normalize to 1000dpi, because the rest below relies on that */
speed_in = speed_in * DEFAULT_MOUSE_DPI/accel_filter->dpi;
/*
Our acceleration function calculates a factor to accelerate input
deltas with. The function is a double incline with a plateau,