mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-30 15:20:08 +01:00
filter: cap trackpoint scale factor at 1.0
Otherwise we scale up lower-resolution trackpoints' movements, resulting in a
jumpy cursor.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 483123d490)
This commit is contained in:
parent
156e53dc12
commit
168aad057d
1 changed files with 8 additions and 1 deletions
|
|
@ -299,10 +299,17 @@ create_pointer_accelerator_filter_trackpoint(int max_hw_delta)
|
|||
return NULL;
|
||||
|
||||
filter->history_size = ARRAY_LENGTH(filter->history);
|
||||
filter->scale_factor = 1.0 * TRACKPOINT_DEFAULT_RANGE / max_hw_delta;
|
||||
filter->max_accel = TRACKPOINT_DEFAULT_MAX_ACCEL;
|
||||
filter->max_delta = TRACKPOINT_DEFAULT_MAX_DELTA;
|
||||
|
||||
filter->scale_factor = 1.0 * TRACKPOINT_DEFAULT_RANGE / max_hw_delta;
|
||||
|
||||
/* Crop to a maximum 1.0 for the scale factor, otherwise we scale up
|
||||
* events from low-res trackpoints when really we should just take
|
||||
* those as-is.
|
||||
*/
|
||||
filter->scale_factor = min(1.0, filter->scale_factor);
|
||||
|
||||
filter->base.interface = &accelerator_interface_trackpoint;
|
||||
|
||||
return &filter->base;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue