summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-02-09 12:17:38 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-03-05 15:51:17 +1000
commita437d9374bc69495f7c64859dc0e1bd470d01baa (patch)
treee49a7420fbd91dd60cc213b7aa25bd58c0a0c3e8 /src
parentb1ddd1effe0bed6993571d7a56cb9fd9d2363996 (diff)
touchpad: enable palm detection on tablets' touchpads
https://bugs.freedesktop.org/show_bug.cgi?id=104986 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/evdev-mt-touchpad.c18
-rw-r--r--src/evdev.c8
-rw-r--r--src/evdev.h1
3 files changed, 21 insertions, 6 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index c649db54..3c9539f2 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -2788,6 +2788,12 @@ tp_is_tpkb_combo_below(struct evdev_device *device)
layout == TPKBCOMBO_LAYOUT_BELOW;
}
+static inline bool
+tp_is_tablet(struct evdev_device *device)
+{
+ return device->tags & EVDEV_TAG_TABLET_TOUCHPAD;
+}
+
static void
tp_init_dwt(struct tp_dispatch *tp,
struct evdev_device *device)
@@ -2885,9 +2891,6 @@ tp_init_palmdetect_size(struct tp_dispatch *tp,
const char *prop;
int threshold;
- if (!tp->touch_size.use_touch_size)
- return;
-
prop = udev_device_get_property_value(device->udev_device,
"LIBINPUT_ATTR_PALM_SIZE_THRESHOLD");
if (!prop)
@@ -2934,17 +2937,20 @@ tp_init_palmdetect(struct tp_dispatch *tp,
tp_init_palmdetect_arbitration(tp, device);
if (device->tags & EVDEV_TAG_EXTERNAL_TOUCHPAD &&
- !tp_is_tpkb_combo_below(device))
+ !tp_is_tpkb_combo_below(device) &&
+ !tp_is_tablet(device))
return;
- tp->palm.monitor_trackpoint = true;
+ if (!tp_is_tablet(device))
+ tp->palm.monitor_trackpoint = true;
if (libevdev_has_event_code(device->evdev,
EV_ABS,
ABS_MT_TOOL_TYPE))
tp->palm.use_mt_tool = true;
- tp_init_palmdetect_edge(tp, device);
+ if (!tp_is_tablet(device))
+ tp_init_palmdetect_edge(tp, device);
tp_init_palmdetect_pressure(tp, device);
tp_init_palmdetect_size(tp, device);
}
diff --git a/src/evdev.c b/src/evdev.c
index 257824aa..5c979ed1 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -441,6 +441,12 @@ evdev_tag_keyboard(struct evdev_device *device,
device->tags |= EVDEV_TAG_KEYBOARD;
}
+static void
+evdev_tag_tablet_touchpad(struct evdev_device *device)
+{
+ device->tags |= EVDEV_TAG_TABLET_TOUCHPAD;
+}
+
static int
evdev_calibration_has_matrix(struct libinput_device *libinput_device)
{
@@ -1638,6 +1644,8 @@ evdev_configure_device(struct evdev_device *device)
}
if (udev_tags & EVDEV_UDEV_TAG_TOUCHPAD) {
+ if (udev_tags & EVDEV_UDEV_TAG_TABLET)
+ evdev_tag_tablet_touchpad(device);
dispatch = evdev_mt_touchpad_create(device);
evdev_log_info(device, "device is a touchpad\n");
return dispatch;
diff --git a/src/evdev.h b/src/evdev.h
index 7fc21690..db2ae545 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -72,6 +72,7 @@ enum evdev_device_tags {
EVDEV_TAG_INTERNAL_KEYBOARD = (1 << 6),
EVDEV_TAG_EXTERNAL_KEYBOARD = (1 << 7),
EVDEV_TAG_TABLET_MODE_SWITCH = (1 << 8),
+ EVDEV_TAG_TABLET_TOUCHPAD = (1 << 9),
};
enum evdev_middlebutton_state {