[PATCH 3/3 weston] evdev: Add has_rel for consistency.

Scott Moreau oreaus at gmail.com
Mon Aug 6 00:27:09 PDT 2012


The primary purpose for this here is to give us a better chance to log unused
devices that might be considered an input device.
---
 src/evdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index a0a162c..6a613f8 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -371,11 +371,12 @@ evdev_configure_device(struct evdev_input_device *device)
 	unsigned long abs_bits[NBITS(ABS_MAX)];
 	unsigned long rel_bits[NBITS(REL_MAX)];
 	unsigned long key_bits[NBITS(KEY_MAX)];
-	int has_key, has_abs;
+	int has_key, has_abs, has_rel;
 	unsigned int i, pointer_caps_mask;
 
 	has_key = 0;
 	has_abs = 0;
+	has_rel = 0;
 	device->caps = 0;
 
 	ioctl(device->fd, EVIOCGBIT(0, sizeof(ev_bits)), ev_bits);
@@ -411,6 +412,7 @@ evdev_configure_device(struct evdev_input_device *device)
 		}
 	}
 	if (TEST_BIT(ev_bits, EV_REL)) {
+		has_rel = 1;
 		ioctl(device->fd, EVIOCGBIT(EV_REL, sizeof(rel_bits)),
 		      rel_bits);
 		if (TEST_BIT(rel_bits, REL_X) || TEST_BIT(rel_bits, REL_Y))
@@ -467,7 +469,7 @@ evdev_configure_device(struct evdev_input_device *device)
 		weston_seat_init_touch(device->seat);
 		weston_log("input device %s, %s is a touch device\n",
 			   device->devname, device->devnode);
-	} else if (has_abs || has_key || device->is_mt) {
+	} else if (has_abs || has_key || has_rel || device->is_mt) {
 		weston_log("input device %s, %s "
 			   "ignored: unsupported device type\n",
 			   device->devname, device->devnode);
-- 
1.7.11.2



More information about the wayland-devel mailing list