summaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-08-08 12:03:08 +1000
committerKristian Høgsberg <krh@bitplanet.net>2013-08-08 13:46:14 -0700
commit45d659dd820dc1fd9baee91fdfaba01966ddfd75 (patch)
treefb77c6d95c62e8860e7bbf3d5e57c6fe443cdad1 /src/evdev.c
parentf3d62276d20750e636fc82bc89b3c4c23576299d (diff)
evdev: check for ABS_MT_POSITION_X/Y to determine mt devices
mtdev as currently used in weston is a noop. mtdev's purpose is to convert Protocol A devices (without ABS_MT_SLOT) to Protocol B devices (slots). For Protocol B devices mtdev merely routes the events, so checking for slots and then using mtdev based on that adds no functionality. Check for ABS_MT_POSITION_X/Y instead and use that to categorise a device as MT device. mtdev will provide us with a slotted protocol for all devices. https://bugs.freedesktop.org/show_bug.cgi?id=54428
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index e9fd8091..fc5004c2 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -454,7 +454,11 @@ evdev_handle_device(struct evdev_device *device)
device->abs.max_y = absinfo.maximum;
device->caps |= EVDEV_MOTION_ABS;
}
- if (TEST_BIT(abs_bits, ABS_MT_SLOT)) {
+ /* We only handle the slotted Protocol B in weston.
+ Devices with ABS_MT_POSITION_* but not ABS_MT_SLOT
+ require mtdev for conversion. */
+ if (TEST_BIT(abs_bits, ABS_MT_POSITION_X) &&
+ TEST_BIT(abs_bits, ABS_MT_POSITION_Y)) {
ioctl(device->fd, EVIOCGABS(ABS_MT_POSITION_X),
&absinfo);
device->abs.min_x = absinfo.minimum;