summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-07-15 16:01:49 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-07-16 14:38:12 +1000
commit8665e3678ab07b7071c70d75b137e0528be70e84 (patch)
tree91c527e51d755de3698ebd0daca92874a801a987
parent9de131f08253595821cb94a083dcc1ff62325467 (diff)
downloadlibinput-8665e3678ab07b7071c70d75b137e0528be70e84.tar.gz
touchpad: check the pointer touch for history size
The current touch may not be the pointer touch, so it's pointless checking the history size on that touch. Instead, search for the pointer touch first, check if it's dirty and then check the history size. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev-mt-touchpad.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 69b63e05..c7fd3a12 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -524,23 +524,23 @@ tp_post_events(struct tp_dispatch *tp, uint64_t time)
if (tp_post_scroll_events(tp, time) != 0)
return;
- if (t->history.count >= TOUCHPAD_MIN_SAMPLES) {
- if (!t->is_pointer) {
- tp_for_each_touch(tp, t) {
- if (t->is_pointer)
- break;
- }
+ if (!t->is_pointer) {
+ tp_for_each_touch(tp, t) {
+ if (t->is_pointer)
+ break;
}
+ }
- if (!t->is_pointer)
- return;
+ if (!t->is_pointer ||
+ !t->dirty ||
+ t->history.count < TOUCHPAD_MIN_SAMPLES)
+ return;
- tp_get_delta(t, &dx, &dy);
- tp_filter_motion(tp, &dx, &dy, time);
+ tp_get_delta(t, &dx, &dy);
+ tp_filter_motion(tp, &dx, &dy, time);
- if (dx != 0.0 || dy != 0.0)
- pointer_notify_motion(&tp->device->base, time, dx, dy);
- }
+ if (dx != 0.0 || dy != 0.0)
+ pointer_notify_motion(&tp->device->base, time, dx, dy);
}
static void