mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-22 17:10:15 +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,
|
/* 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 */
|
worst case we don't read fast enough and end up with SYN_DROPPED anyway */
|
||||||
rc = read_more_events(dev);
|
do {
|
||||||
if (rc < 0 && rc != -EAGAIN)
|
rc = read_more_events(dev);
|
||||||
goto out;
|
if (rc < 0 && rc != -EAGAIN)
|
||||||
|
goto out;
|
||||||
|
|
||||||
if (flags & LIBEVDEV_FORCE_SYNC) {
|
if (flags & LIBEVDEV_FORCE_SYNC) {
|
||||||
dev->need_sync = 1;
|
dev->need_sync = 1;
|
||||||
rc = 1;
|
rc = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (queue_shift(dev, ev) != 0)
|
if (queue_shift(dev, ev) != 0)
|
||||||
return -EAGAIN;
|
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;
|
rc = 0;
|
||||||
if (ev->type == EV_SYN && ev->code == SYN_DROPPED) {
|
if (ev->type == EV_SYN && ev->code == SYN_DROPPED) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue