From: Peter Hutterer Date: Wed, 19 Feb 2020 03:28:38 +0000 (+1000) Subject: Don't try to send BTN_TOOL events for zero fingers X-Git-Tag: libevdev-1.8.901~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27aaba81d5978f3dd7e2b3de32b27c5f6be5fd0f;p=platform%2Fupstream%2Flibevdev.git Don't try to send BTN_TOOL events for zero fingers Signed-off-by: Peter Hutterer --- diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c index bd6fc96..e6323d1 100644 --- a/libevdev/libevdev.c +++ b/libevdev/libevdev.c @@ -780,7 +780,7 @@ terminate_slots(struct libevdev *dev, * sync event frame sync_key_state() sets everything correctly * for the *real* number of touches. */ - if (ntouches_before <= 5) { + if (ntouches_before > 0 && ntouches_before <= 5) { struct input_event ev = { .type = EV_KEY, .code = map[ntouches_before - 1], @@ -790,7 +790,7 @@ terminate_slots(struct libevdev *dev, update_key_state(dev, &ev); } - if (ntouches_after <= 5) { + if (ntouches_after > 0 && ntouches_after <= 5) { struct input_event ev = { .type = EV_KEY, .code = map[ntouches_after - 1],