summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-02-15 17:02:45 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-02-18 10:38:20 +1000
commit79139ebcd1cc81eecdd2d0dc6f006fbec4c2c6f2 (patch)
treedbcf6e5a23af05153576964b200e5cc3c9dca51c /src
parentd6b889852abd3e5f238769be55cb4a30e5db6dcb (diff)
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. On touchpads with physical buttons or if clickfinger is enabled, the no-tapping zone extends to the bottom of the touchpad. This required splitting the tests into clickfinger, softbuttons and hardbuttons. https://bugs.freedesktop.org/show_bug.cgi?id=93947 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/evdev-mt-touchpad.c11
-rw-r--r--src/evdev-mt-touchpad.h1
2 files changed, 4 insertions, 8 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 912a0f0f..95d650a9 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 87d34b20..eae327bf 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;