touchpad: Ignore non left clicks on clickpads

We should never get any non left button events on clickpads, but if we
do these might confuse our state, so complain about it and ignore these.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Hans de Goede 2014-04-07 13:50:11 +02:00
parent f6c3731f8a
commit a4bd36071e

View file

@ -367,6 +367,14 @@ tp_process_button(struct tp_dispatch *tp,
uint32_t time)
{
uint32_t mask = 1 << (e->code - BTN_LEFT);
/* Ignore other buttons on clickpads */
if (tp->buttons.is_clickpad && e->code != BTN_LEFT) {
log_bug("received %s button event on a clickpad (kernel bug?)\n",
libevdev_event_code_get_name(EV_KEY, e->code));
return 0;
}
if (e->value) {
tp->buttons.state |= mask;
tp->queued |= TOUCHPAD_EVENT_BUTTON_PRESS;