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:
Peter Hutterer 2018-04-24 15:01:39 +10:00
parent 132001f3ea
commit 7d06ccc061

View file

@ -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 */