summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-07-06 07:59:31 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-08-05 08:58:34 +1000
commit6614604e9abd1cf602669b35efb2aed107c7972c (patch)
tree26aa2cdb79e394fde8267038ae8ef68fec495eee
parentd7d64d98716431a62deb2d1440df49f9d5d7de1f (diff)
touchpad: use the udev ID_INPUT_TOUCHPAD_INTEGRATION property if available
udev now labels touchpads as "internal" or "external" for us, use that value where available and only fall back onto our own labelling if it's missing or unknown. systemd commit: https://github.com/systemd/systemd/pull/3638 https://bugs.freedesktop.org/show_bug.cgi?id=96735 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 64e39411892fa4897f6e018daaa2de2ffaf8b671)
-rw-r--r--src/evdev-mt-touchpad.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index a7b5a872..756d2839 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1589,6 +1589,24 @@ evdev_tag_touchpad(struct evdev_device *device,
struct udev_device *udev_device)
{
int bustype, vendor;
+ const char *prop;
+
+ prop = udev_device_get_property_value(udev_device,
+ "ID_INPUT_TOUCHPAD_INTEGRATION");
+ if (prop) {
+ if (streq(prop, "internal")) {
+ evdev_tag_touchpad_internal(device);
+ return;
+ } else if (streq(prop, "external")) {
+ evdev_tag_touchpad_external(device);
+ return;
+ } else {
+ log_info(evdev_libinput_context(device),
+ "%s: tagged as unknown value %s\n",
+ device->devname,
+ prop);
+ }
+ }
/* simple approach: touchpads on USB or Bluetooth are considered
* external, anything else is internal. Exception is Apple -