summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2022-09-05 09:46:54 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2022-09-08 09:03:15 +1000
commit49707691c8ee8d167ef2dca558e31b5f6cf6d68c (patch)
tree383195668395e50c9ec3a70992c9ae7b06da9a63
parentf87fffd1937062d8e67ec77ff86f7b2b1495027a (diff)
downloadlibinput-49707691c8ee8d167ef2dca558e31b5f6cf6d68c.tar.gz
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>
-rw-r--r--src/filter-mouse.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/filter-mouse.c b/src/filter-mouse.c
index 8f572752..a2284c00 100644
--- a/src/filter-mouse.c
+++ b/src/filter-mouse.c
@@ -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,