Skip to content

Commit

Permalink
touchpad: end hovering touches in maybe_end_touch
Browse files Browse the repository at this point in the history
Otherwise a hovering touch stays around forever even after the finger has
discontinued. This doesn't matter on slots, but for fake fingers the finger
may suddenly end up being forced down/up as a result of the pressure changes
on the real fingers.

So when in maybe_end_touch, switch them back to NONE immediately - hovering
touches do not need to trigger a TOUCH_END event.

https://bugs.freedesktop.org/show_bug.cgi?id=105258

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d8db6b5)
  • Loading branch information
whot committed Mar 12, 2018
1 parent eeb967b commit 42e8813
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/evdev-mt-touchpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,22 +345,26 @@ tp_maybe_end_touch(struct tp_dispatch *tp,
switch (t->state) {
case TOUCH_NONE:
case TOUCH_MAYBE_END:
case TOUCH_HOVERING:
return;
case TOUCH_END:
evdev_log_bug_libinput(tp->device,
"touch already in TOUCH_END\n");
return;
case TOUCH_HOVERING:
case TOUCH_BEGIN:
case TOUCH_UPDATE:
break;
}

t->dirty = true;
t->state = TOUCH_MAYBE_END;
if (t->state != TOUCH_HOVERING) {
assert(tp->nfingers_down >= 1);
tp->nfingers_down--;
t->state = TOUCH_MAYBE_END;
} else {
t->state = TOUCH_NONE;
}

assert(tp->nfingers_down >= 1);
tp->nfingers_down--;
t->dirty = true;
}

/**
Expand Down

0 comments on commit 42e8813

Please sign in to comment.