commit 128a997

Michael Forney  ·  2016-12-30 07:19:12 +0000 UTC
parent e60ccbe
evdev: Only process abs/rel events from pointers
1 files changed,  +6, -0
+6, -0
 1@@ -70,6 +70,9 @@ handle_rel_event(struct evdev_device *device, struct input_event *ev)
 2 	uint32_t time = timeval_to_msec(&ev->time);
 3 	uint32_t axis, amount;
 4 
 5+	if (!(device->capabilities & WL_SEAT_CAPABILITY_POINTER))
 6+		return;
 7+
 8 	switch (ev->code) {
 9 	case REL_X:
10 		device->rel.dx += ev->value;
11@@ -97,6 +100,9 @@ handle_rel_event(struct evdev_device *device, struct input_event *ev)
12 static void
13 handle_abs_event(struct evdev_device *device, struct input_event *ev)
14 {
15+	if (!(device->capabilities & WL_SEAT_CAPABILITY_POINTER))
16+		return;
17+
18 	switch (ev->code) {
19 	case ABS_X:
20 		device->abs.x = ev->value;