mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-22 16:00:08 +01:00
Don't deliver events that are filtered
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
0aa639b443
commit
2ae4dc003a
1 changed files with 15 additions and 11 deletions
|
|
@ -556,21 +556,25 @@ int libevdev_next_event(struct libevdev *dev, unsigned int flags, struct input_e
|
|||
|
||||
/* 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 */
|
||||
rc = read_more_events(dev);
|
||||
if (rc < 0 && rc != -EAGAIN)
|
||||
goto out;
|
||||
do {
|
||||
rc = read_more_events(dev);
|
||||
if (rc < 0 && rc != -EAGAIN)
|
||||
goto out;
|
||||
|
||||
if (flags & LIBEVDEV_FORCE_SYNC) {
|
||||
dev->need_sync = 1;
|
||||
rc = 1;
|
||||
goto out;
|
||||
}
|
||||
if (flags & LIBEVDEV_FORCE_SYNC) {
|
||||
dev->need_sync = 1;
|
||||
rc = 1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
if (queue_shift(dev, ev) != 0)
|
||||
return -EAGAIN;
|
||||
if (queue_shift(dev, ev) != 0)
|
||||
return -EAGAIN;
|
||||
|
||||
update_state(dev, ev);
|
||||
update_state(dev, ev);
|
||||
|
||||
/* if we disabled a code, get the next event instead */
|
||||
} while(!libevdev_has_event_code(dev, ev->type, ev->code));
|
||||
|
||||
rc = 0;
|
||||
if (ev->type == EV_SYN && ev->code == SYN_DROPPED) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue