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>
(cherry picked from commit bc17185f42)
This commit is contained in:
Peter Hutterer 2016-03-29 13:34:00 +10:00
parent 915cd9d999
commit 2253cf69cb
2 changed files with 3 additions and 5 deletions

View file

@ -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:

View file

@ -904,10 +904,7 @@ tp_need_motion_history_reset(struct tp_dispatch *tp, uint64_t time)
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;