diff options
| author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-07-01 15:30:49 +1000 |
|---|---|---|
| committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-07-02 10:58:57 +1000 |
| commit | a10fc33cd8f3b12c7acd862ab0504b5465fb36ca (patch) | |
| tree | e293dd310dfce59090881dd56c34afce9cfb4181 /libevdev | |
| parent | d347e7d4e421a666963b39f0fc52740f53390946 (diff) | |
| download | libevdev-a10fc33cd8f3b12c7acd862ab0504b5465fb36ca.tar.gz | |
If the caller doesn't sync when it should, process all events regardless
libevdev needs to maintain the correct state of the device, even if the caller
decides to drop all delta events after a SYN_DROPPED.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'libevdev')
| -rw-r--r-- | libevdev/libevdev.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c index d326c8d..590e2d6 100644 --- a/libevdev/libevdev.c +++ b/libevdev/libevdev.c @@ -548,10 +548,12 @@ int libevdev_next_event(struct libevdev *dev, unsigned int flags, struct input_e return rc; } } else if (dev->need_sync) { - /* FIXME: still need to call update_state for all events - * here, otherwise the library has the wrong view of the - * device too */ - queue_shift_multiple(dev, dev->queue_nsync, NULL); + struct input_event e; + + /* call update_state for all events here, otherwise the library has the wrong view + of the device too */ + while (queue_shift(dev, &e) == 0) + update_state(dev, &e); } /* FIXME: check for O_NONBLOCK and if not set, skip if we have an |
