mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-21 16:40:05 +01:00
filter: require minimum acceleration factor of 0.3
For really slow motions, the previous acceleration factor would go down to
effectively zero. So the slower the mouse motion was, the more it would be
slowed down which made the mouse at low speeds almost unusable.
Cap the minimum acceleration at 0.3 which provides a predictable slow motion
for the cursor when high precision is required.
New/old acceleration functions comparison:
^
| /
| /
ty| _________/
| / /
| / /
| / /
|/ / <----- new minimum accel factor
| /
|/___________________>
tx
i.e. the general shape is maintained, but it doesn't go to zero anymore. The
functions aren't parallel, the new shape is slightly flatter than the previous
one and they meet at the point where the functions flatten for the threshold
(tx/ty). ascii art has its limits...
https://bugzilla.redhat.com/show_bug.cgi?id=1227039
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
105e725602
commit
69449ca854
1 changed files with 1 additions and 1 deletions
|
|
@ -385,7 +385,7 @@ pointer_accel_profile_linear(struct motion_filter *filter,
|
||||||
const double threshold = accel_filter->threshold; /* units/ms */
|
const double threshold = accel_filter->threshold; /* units/ms */
|
||||||
const double incline = accel_filter->incline;
|
const double incline = accel_filter->incline;
|
||||||
|
|
||||||
s1 = min(1, speed_in * 5);
|
s1 = min(1, 0.3 + speed_in * 4);
|
||||||
s2 = 1 + (speed_in - threshold) * incline;
|
s2 = 1 + (speed_in - threshold) * incline;
|
||||||
|
|
||||||
return min(max_accel, s2 > 1 ? s2 : s1);
|
return min(max_accel, s2 > 1 ? s2 : s1);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue