mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-03-22 09:10:40 +01:00
filter: always average the velocity of the first two events
Don't apply any velocity diff checking on the first two events, always average them (unless the timeout is hit or the direction changes). This averages out some of the jumps we get on slow motion. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
132001f3ea
commit
7d06ccc061
1 changed files with 4 additions and 1 deletions
|
|
@ -248,7 +248,10 @@ trackers_velocity(struct pointer_trackers *trackers, uint64_t time)
|
|||
break;
|
||||
}
|
||||
|
||||
if (initial_velocity == 0.0) {
|
||||
/* Always average the first two events. On some touchpads
|
||||
* where the first event is jumpy, this somewhat reduces
|
||||
* pointer jumps on slow motions. */
|
||||
if (initial_velocity == 0.0 || offset <= 2) {
|
||||
result = initial_velocity = velocity;
|
||||
} else {
|
||||
/* Stop if velocity differs too much from initial */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue