mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 08:00:08 +01:00
evdev: Reset accumulate values when we flush motion events
Otherwise we end up reporting all motion events twice.
This commit is contained in:
parent
c6fc7c3d21
commit
0090c3b29e
1 changed files with 6 additions and 1 deletions
|
|
@ -229,9 +229,14 @@ evdev_input_device_data(int fd, uint32_t mask, void *data)
|
||||||
/* we try to minimize the amount of notifications to be
|
/* we try to minimize the amount of notifications to be
|
||||||
* forwarded to the compositor, so we accumulate motion
|
* forwarded to the compositor, so we accumulate motion
|
||||||
* events and send as a bunch */
|
* events and send as a bunch */
|
||||||
if (!is_motion_event(e))
|
if (!is_motion_event(e)) {
|
||||||
evdev_flush_motion(&device->master->base.input_device,
|
evdev_flush_motion(&device->master->base.input_device,
|
||||||
time, x, y, dx, dy, absolute_event);
|
time, x, y, dx, dy, absolute_event);
|
||||||
|
dx = 0;
|
||||||
|
dy = 0;
|
||||||
|
absolute_event = 0;
|
||||||
|
}
|
||||||
|
|
||||||
switch (e->type) {
|
switch (e->type) {
|
||||||
case EV_REL:
|
case EV_REL:
|
||||||
evdev_process_relative_motion(e, &dx, &dy);
|
evdev_process_relative_motion(e, &dx, &dy);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue