From 09a79656a27c42699f4a9c8d97df171938e009ef Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Fri, 22 May 2015 15:14:04 +1000
Subject: [PATCH libinput 07/10] touchpad: add palm state debugging
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
---
src/evdev-mt-touchpad.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index ad20fb9..56a70cc 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -472,8 +472,11 @@ tp_palm_tap_is_palm(struct tp_dispatch *tp, struct tp_touch *t)
/* We're inside the left/right palm edge and in the northern half of
* the touchpad - this tap is a palm */
- if (t->point.y < tp->palm.vert_center)
+ if (t->point.y < tp->palm.vert_center) {
+ log_debug(tp_libinput_context(tp),
+ "palm: palm-tap detected\n");
return true;
+ }
return false;
}
@@ -503,7 +506,7 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time)
int dirs;
if (tp_palm_detect_dwt(tp, t, time))
- return;
+ goto out;
/* If labelled a touch as palm, we unlabel as palm when
we move out of the palm edge zone within the timeout, provided
@@ -517,6 +520,8 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time)
tp_normalize_delta(tp, delta));
if ((dirs & DIRECTIONS) && !(dirs & ~DIRECTIONS)) {
t->palm.state = PALM_NONE;
+ log_debug(tp_libinput_context(tp),
+ "palm: touch released, out of edge zone\n");
}
}
return;
@@ -538,6 +543,11 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time)
t->palm.state = PALM_EDGE;
t->palm.time = time;
t->palm.first = t->point;
+
+out:
+ log_debug(tp_libinput_context(tp),
+ "palm: palm detected (%s)\n",
+ t->palm.state == PALM_EDGE ? "edge" : "typing");
}
static void
@@ -879,7 +889,10 @@ tp_keyboard_timeout(uint64_t now, void *data)
struct tp_dispatch *tp = data;
tp_tap_resume(tp, now);
+
tp->dwt.keyboard_active = false;
+
+ log_debug(tp_libinput_context(tp), "palm: keyboard timeout\n");
}
static inline bool
@@ -1004,6 +1017,11 @@ tp_device_added(struct evdev_device *device,
if (added_device->tags & EVDEV_TAG_KEYBOARD &&
tp->dwt.keyboard == NULL &&
tp_want_dwt(device, added_device)) {
+ log_debug(tp_libinput_context(tp),
+ "palm: dwt activated with %s<->%s\n",
+ device->devname,
+ added_device->devname);
+
libinput_device_add_event_listener(&added_device->base,
&tp->dwt.keyboard_listener,
tp_keyboard_event, tp);
--
2.4.1