From 69a600d99dc881abcef34fab00b320810ca119bb Mon Sep 17 00:00:00 2001 From: Tiger Soldier Date: Sun, 13 Dec 2015 22:27:55 -0800 Subject: [PATCH] touchpad: for apple unibody touchpad, disable keyboards that are not the same product id for dwt --- src/evdev-mt-touchpad.c | 11 +++++++++++ src/libinput-util.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 4fba147..6f13d22 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -1285,6 +1285,10 @@ tp_want_dwt(struct evdev_device *touchpad, { unsigned int bus_tp = libevdev_get_id_bustype(touchpad->evdev), bus_kbd = libevdev_get_id_bustype(keyboard->evdev); + unsigned int vendor_tp = evdev_device_get_id_vendor(touchpad); + unsigned int vendor_kbd = evdev_device_get_id_vendor(keyboard); + unsigned int product_tp = evdev_device_get_id_product(touchpad); + unsigned int product_kbd = evdev_device_get_id_product(keyboard); if (tp_dwt_device_is_blacklisted(touchpad) || tp_dwt_device_is_blacklisted(keyboard)) @@ -1295,6 +1299,13 @@ tp_want_dwt(struct evdev_device *touchpad, if (bus_tp == BUS_I8042 && bus_kbd != bus_tp) return false; + /* For Macbook Pro, always use its internal keyboard and touchpad */ + if (vendor_tp == VENDOR_ID_APPLE + && product_tp == PRODUCT_ID_APPLE_KBD_TOUCHPAD) { + return vendor_kbd == VENDOR_ID_APPLE + && product_kbd == PRODUCT_ID_APPLE_KBD_TOUCHPAD; + } + /* everything else we don't really know, so we have to assume they go together */ diff --git a/src/libinput-util.h b/src/libinput-util.h index ba253b5..d76f333 100644 --- a/src/libinput-util.h +++ b/src/libinput-util.h @@ -38,6 +38,7 @@ #define VENDOR_ID_APPLE 0x5ac #define VENDOR_ID_WACOM 0x56a #define VENDOR_ID_SYNAPTICS_SERIAL 0x002 +#define PRODUCT_ID_APPLE_KBD_TOUCHPAD 0x273 #define PRODUCT_ID_SYNAPTICS_SERIAL 0x007 /* The HW DPI rate we normalize to before calculating pointer acceleration */ -- 2.6.3