touchpad: add palm state debugging
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 22 May 2015 05:14:04 +0000 (15:14 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 27 May 2015 07:38:25 +0000 (17:38 +1000)
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

index 0b644d9a7c1156b2816adb40f3a492e5316d3443..994effece08f12e8ec1410c137d56ddfa745af6a 100644 (file)
@@ -475,8 +475,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;
 }
@@ -506,7 +509,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
@@ -520,6 +523,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;
@@ -541,6 +546,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
@@ -923,7 +933,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
@@ -1048,6 +1061,11 @@ tp_interface_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);