From 3e22ef86ab2c99c1149658febdc7b91916fb5a45 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 30 May 2013 12:24:46 +1000 Subject: [PATCH] If a client doesn't sync when it should, drop all sync events Signed-off-by: Peter Hutterer --- libevdev/libevdev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c index 2c5742e..173f33c 100644 --- a/libevdev/libevdev.c +++ b/libevdev/libevdev.c @@ -512,10 +512,8 @@ int libevdev_next_event(struct libevdev *dev, unsigned int flags, struct input_e if (rc != 0) return rc; } - } else if (dev->need_sync) { - /* FIXME: if a client decides not to sync, drop all sync events */ - return 1; - } + } else if (dev->need_sync) + queue_shift_multiple(dev, dev->queue_nsync, NULL); /* Always read in some more events. Best case this smoothes over a potential SYN_DROPPED, worst case we don't read fast enough and end up with SYN_DROPPED anyway */