From 43b59959e189fa967ad0fd4d3f2d51061ac5b1d7 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 28 Sep 2010 11:28:45 +0200 Subject: Only support pure absolute devices at this time There are some hybrid relative/absolute devices out there, like the magic mouse, for which special behavior, outside the current scope of grail, is expected. This patch disables grail for those devices. Signed-off-by: Henrik Rydberg --- src/touch-caps.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/touch-caps.c') diff --git a/src/touch-caps.c b/src/touch-caps.c index a51912c..f99b0d7 100644 --- a/src/touch-caps.c +++ b/src/touch-caps.c @@ -48,17 +48,25 @@ int touch_caps_is_supported(struct touch_dev *dev, int fd) { unsigned long keybits[nlongs(KEY_MAX)]; unsigned long absbits[nlongs(ABS_MAX)]; + unsigned long relbits[nlongs(REL_CNT)]; int rc; - if (dev->mtdev.caps.has_mtdata) - return 1; - SYSCALL(rc = ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits)); if (rc < 0) return 0; SYSCALL(rc = ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbits)), absbits)); if (rc < 0) return 0; + SYSCALL(rc = ioctl(fd, EVIOCGBIT(EV_REL, sizeof(relbits)), relbits)); + if (rc < 0) + return 0; + + /* only support pure absolute devices at this time */ + if (getbit(relbits, REL_X) || getbit(relbits, REL_Y)) + return 0; + + if (dev->mtdev.caps.has_mtdata) + return 1; return getbit(absbits, ABS_X) && getbit(absbits, ABS_Y) && -- cgit v1.2.3