touchpad: don't enable edge palm detection on Wacom touchpads
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 25 May 2015 06:02:56 +0000 (16:02 +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
test/touchpad.c

index 994effece08f12e8ec1410c137d56ddfa745af6a..db330ec0ab7248f47dd4989ccade199fed2b4908 100644 (file)
@@ -1372,6 +1372,7 @@ tp_init_palmdetect(struct tp_dispatch *tp,
                   struct evdev_device *device)
 {
        int width, height;
+       unsigned int vendor_id;
 
        tp->palm.right_edge = INT_MAX;
        tp->palm.left_edge = INT_MIN;
@@ -1382,8 +1383,13 @@ tp_init_palmdetect(struct tp_dispatch *tp,
        height = abs(device->abs.absinfo_y->maximum -
                    device->abs.absinfo_y->minimum);
 
-       /* Apple touchpads are always big enough to warrant palm detection */
-       if (evdev_device_get_id_vendor(device) != VENDOR_ID_APPLE) {
+       vendor_id = evdev_device_get_id_vendor(device);
+
+       /* Wacom doesn't have internal touchpads,
+        * Apple touchpads are always big enough to warrant palm detection */
+       if (vendor_id == VENDOR_ID_WACOM) {
+               return 0;
+       } else if (vendor_id != VENDOR_ID_APPLE) {
                /* We don't know how big the touchpad is */
                if (device->abs.absinfo_x->resolution == 1)
                        return 0;
index f8ee6e1954e7b032fd930d5f68221cb1b8010a9d..fc7743964b9bfb31d841a20d27665cedfc2771b8 100644 (file)
@@ -3198,9 +3198,13 @@ static int
 touchpad_has_palm_detect_size(struct litest_device *dev)
 {
        double width, height;
+       unsigned int vendor;
        int rc;
 
-       if (libinput_device_get_id_vendor(dev->libinput_device) == ID_VENDOR_APPLE)
+       vendor = libinput_device_get_id_vendor(dev->libinput_device);
+       if (vendor == VENDOR_ID_WACOM)
+               return 0;
+       if (vendor == VENDOR_ID_APPLE)
                return 1;
 
        rc = libinput_device_get_size(dev->libinput_device, &width, &height);