swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit 128a997d1102cd08a2185922b65bda54cb91e339
parent e60ccbe9353902245b67e49c863a747feaf74b6a
Author: Michael Forney <mforney@mforney.org>
Date:   Thu, 29 Dec 2016 23:19:12 -0800

evdev: Only process abs/rel events from pointers

Diffstat:
Mlibswc/evdev_device.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/libswc/evdev_device.c b/libswc/evdev_device.c @@ -70,6 +70,9 @@ handle_rel_event(struct evdev_device *device, struct input_event *ev) uint32_t time = timeval_to_msec(&ev->time); uint32_t axis, amount; + if (!(device->capabilities & WL_SEAT_CAPABILITY_POINTER)) + return; + switch (ev->code) { case REL_X: device->rel.dx += ev->value; @@ -97,6 +100,9 @@ handle_rel_event(struct evdev_device *device, struct input_event *ev) static void handle_abs_event(struct evdev_device *device, struct input_event *ev) { + if (!(device->capabilities & WL_SEAT_CAPABILITY_POINTER)) + return; + switch (ev->code) { case ABS_X: device->abs.x = ev->value;