From 1748ddaf3d7d577f0f81da862f80e13033c44896 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 23 Feb 2023 16:01:47 +1000 Subject: [PATCH] eis: don't EINVAL if a coordinate is outside the region From the documentation: "The x/y coordinate must be within the device's regions or the event is silently discarded." libei discards it but if it somehow makes it through anyway, let's discard it again. --- src/libeis-device.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libeis-device.c b/src/libeis-device.c index bce5674..c4fed70 100644 --- a/src/libeis-device.c +++ b/src/libeis-device.c @@ -740,10 +740,8 @@ eis_device_event_pointer_abs(struct eis_device *device, if (device->state != EIS_DEVICE_STATE_EMULATING) return -EINVAL; - if (!eis_device_in_region(device, x, y)) - return -EINVAL; - - eis_queue_pointer_abs_event(device, x, y); + if (eis_device_in_region(device, x, y)) + eis_queue_pointer_abs_event(device, x, y); return 0; }