Cap the minimum acceleration slowdown at 0.3 (#1227796)
This commit is contained in:
parent
bdcf52556f
commit
4d3b8a54fe
52
0001-filter-require-minimum-acceleration-factor-of-0.3.patch
Normal file
52
0001-filter-require-minimum-acceleration-factor-of-0.3.patch
Normal file
@ -0,0 +1,52 @@
|
||||
From f6313a9d010f03a66fd1f68e0bbd5e073101f342 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Thu, 4 Jun 2015 11:40:15 +1000
|
||||
Subject: [PATCH libinput] 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...
|
||||
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
src/filter.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/filter.c b/src/filter.c
|
||||
index c54d866..ed5a184 100644
|
||||
--- a/src/filter.c
|
||||
+++ b/src/filter.c
|
||||
@@ -354,7 +354,7 @@ pointer_accel_profile_linear(struct motion_filter *filter,
|
||||
const double threshold = accel_filter->threshold; /* units/ms */
|
||||
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;
|
||||
|
||||
return min(max_accel, s2 > 1 ? s2 : s1);
|
||||
--
|
||||
2.4.1
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
Name: libinput
|
||||
Version: 0.17.0
|
||||
Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
|
||||
Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
|
||||
Summary: Input device library
|
||||
|
||||
License: MIT
|
||||
@ -18,6 +18,8 @@ Source2: commitid
|
||||
Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}.tar.xz
|
||||
%endif
|
||||
|
||||
Patch01: 0001-filter-require-minimum-acceleration-factor-of-0.3.patch
|
||||
|
||||
BuildRequires: git
|
||||
BuildRequires: autoconf automake libtool pkgconfig
|
||||
BuildRequires: libevdev-devel
|
||||
@ -93,6 +95,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Jun 09 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.17.0-2
|
||||
- Cap the minimum acceleration slowdown at 0.3 (#1227796)
|
||||
|
||||
* Thu Jun 04 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.17.0-1
|
||||
- libinput 0.17
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user