[PATCH libinput 14/20] touchpad: Ignore non left clicks on clickpads
Hans de Goede
hdegoede at redhat.com
Tue Apr 15 05:28:11 PDT 2014
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 at redhat.com>
Acked-by: Peter Hutterer <peter.hutterer at who-t.net>
---
src/evdev-mt-touchpad-buttons.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index ec36280..22dbb45 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -370,6 +370,13 @@ 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 non BTN_LEFT button event on a clickpad (kernel bug?)\n");
+ return 0;
+ }
+
if (e->value) {
tp->buttons.state |= mask;
tp->queued |= TOUCHPAD_EVENT_BUTTON_PRESS;
--
1.9.0
More information about the wayland-devel
mailing list