From dd769a07c5aec8ef3e2b420a738d517addd511f1 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 15 Feb 2016 17:02:45 +1000 Subject: [PATCH libinput] touchpad: move the tapping exclusion zone to the top edge of the button We previously used the half-way mark of the touchpad's y axis to decide where to ignore tapping. Move this down to the top edge of the software buttons instead. Users may tap with a finger in the software button areas, on the rest of the touchpad it's unlikely that they tap within 5% of the edge. https://bugs.freedesktop.org/show_bug.cgi?id=93947 Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad.c | 11 ++++------- src/evdev-mt-touchpad.h | 1 - 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index d8b2334..78d18a4 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -538,9 +538,9 @@ tp_palm_tap_is_palm(const struct tp_dispatch *tp, const struct tp_touch *t) t->point.x < tp->palm.right_edge) return false; - /* 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) { + /* We're inside the left/right palm edge and not in one of the + * software button areas */ + if (t->point.y < tp->buttons.bottom_area.top_edge) { log_debug(tp_libinput_context(tp), "palm: palm-tap detected\n"); return true; @@ -1824,14 +1824,12 @@ static int tp_init_palmdetect(struct tp_dispatch *tp, struct evdev_device *device) { - int width, height; + int width; tp->palm.right_edge = INT_MAX; tp->palm.left_edge = INT_MIN; - tp->palm.vert_center = INT_MIN; width = device->abs.dimensions.x; - height = device->abs.dimensions.y; /* Wacom doesn't have internal touchpads */ if (device->model_flags & EVDEV_MODEL_WACOM_TOUCHPAD) @@ -1845,7 +1843,6 @@ tp_init_palmdetect(struct tp_dispatch *tp, /* palm edges are 5% of the width on each side */ tp->palm.right_edge = device->abs.absinfo_x->maximum - width * 0.05; tp->palm.left_edge = device->abs.absinfo_x->minimum + width * 0.05; - tp->palm.vert_center = device->abs.absinfo_y->minimum + height/2; tp->palm.monitor_trackpoint = true; diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h index 87d34b2..eae327b 100644 --- a/src/evdev-mt-touchpad.h +++ b/src/evdev-mt-touchpad.h @@ -321,7 +321,6 @@ struct tp_dispatch { struct { int32_t right_edge; /* in device coordinates */ int32_t left_edge; /* in device coordinates */ - int32_t vert_center; /* in device coordinates */ bool trackpoint_active; struct libinput_event_listener trackpoint_listener; -- 2.5.0