summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-03-29 13:34:00 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-03-29 15:48:17 +1000
commitbc17185f426dae7a1ea4df6ba3459083c2d51f9b (patch)
tree6c6e7eeb976468a9c4dd081542031435f5424ea4 /src
parent31d0464c4af6045a43713a645dc30b020449edbb (diff)
touchpad: only post motion events if we have motion
Because our delta calculation factors in previous events on touchpads (to reduce jitter) we may get a nonzero delta if we have an event that doesn't actually change x or y. Drop the t->dirty workaround introduced in a608d9d, an event that virtually disappears can mess up our state machines. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/evdev-mt-touchpad-gestures.c3
-rw-r--r--src/evdev-mt-touchpad.c5
2 files changed, 3 insertions, 5 deletions
diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index 3c8f5a7a..7bbd3b8c 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -500,7 +500,8 @@ tp_gesture_post_events(struct tp_dispatch *tp, uint64_t time)
switch (tp->gesture.finger_count) {
case 1:
- tp_gesture_post_pointer_motion(tp, time);
+ if (tp->queued & TOUCHPAD_EVENT_MOTION)
+ tp_gesture_post_pointer_motion(tp, time);
break;
case 2:
case 3:
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index f634ec86..e16aecbb 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -904,10 +904,7 @@ tp_need_motion_history_reset(struct tp_dispatch *tp)
if (tp->device->model_flags & EVDEV_MODEL_LENOVO_T450_TOUCHPAD) {
if (tp->queued & TOUCHPAD_EVENT_MOTION) {
if (tp->quirks.nonmotion_event_count > 10) {
- struct tp_touch *t;
-
- tp_for_each_touch(tp, t)
- t->dirty = false;
+ tp->queued &= ~TOUCHPAD_EVENT_MOTION;
rc = true;
}
tp->quirks.nonmotion_event_count = 0;