From ea7a88d213cdca73348a8e310ae491cd1925c6a3 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 20 Sep 2021 11:56:11 +1000 Subject: [PATCH] touchpad: use the model flags to determine internal vs external When pairing a trackpoint, use the model flags for the touchpad, don't use a separate set of conditions. Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 59d457b7..4ddc9e07 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -2406,14 +2406,13 @@ tp_pair_trackpoint(struct evdev_device *touchpad, struct evdev_device *trackpoint) { struct tp_dispatch *tp = (struct tp_dispatch*)touchpad->dispatch; - unsigned int bus_tp = libevdev_get_id_bustype(touchpad->evdev), - bus_trp = libevdev_get_id_bustype(trackpoint->evdev); + unsigned int bus_trp = libevdev_get_id_bustype(trackpoint->evdev); bool tp_is_internal, trp_is_internal; if ((trackpoint->tags & EVDEV_TAG_TRACKPOINT) == 0) return; - tp_is_internal = bus_tp != BUS_USB && bus_tp != BUS_BLUETOOTH; + tp_is_internal = !!(touchpad->tags & EVDEV_TAG_INTERNAL_TOUCHPAD); trp_is_internal = bus_trp != BUS_USB && bus_trp != BUS_BLUETOOTH; if (tp->buttons.trackpoint == NULL &&