evdev: Only init a pointer if the evdev device has a button
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 14 Oct 2013 22:32:08 +0000 (15:32 -0700)
committerJonas Ådahl <jadahl@gmail.com>
Sun, 10 Nov 2013 16:51:33 +0000 (17:51 +0100)
We used to test for abs | rel | button,  which inits a pointer device for
a device with just rel or abs capabilities.  We now make sure we have either
rel or abs as well as button.

src/evdev.c

index e9235d9..0bfe94d 100644 (file)
@@ -555,8 +555,8 @@ evdev_handle_device(struct evdev_device *device)
 static int
 evdev_configure_device(struct evdev_device *device)
 {
-       if ((device->caps &
-            (EVDEV_MOTION_ABS | EVDEV_MOTION_REL | EVDEV_BUTTON))) {
+       if ((device->caps & (EVDEV_MOTION_ABS | EVDEV_MOTION_REL)) &&
+           (device->caps & EVDEV_BUTTON)) {
                weston_seat_init_pointer(device->seat);
                weston_log("input device %s, %s is a pointer caps =%s%s%s\n",
                           device->devname, device->devnode,