mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-08 08:58:04 +02:00
Simplify evdev_flush_motion() a tiny bit
This commit is contained in:
parent
2a3c15ab50
commit
32a940e01a
1 changed files with 4 additions and 7 deletions
|
|
@ -207,16 +207,13 @@ static void
|
||||||
evdev_flush_motion(struct wl_input_device *device, uint32_t time,
|
evdev_flush_motion(struct wl_input_device *device, uint32_t time,
|
||||||
struct evdev_motion_accumulator *accum)
|
struct evdev_motion_accumulator *accum)
|
||||||
{
|
{
|
||||||
if (accum->type == EVDEV_RELATIVE_MOTION) {
|
if (accum->type == EVDEV_RELATIVE_MOTION)
|
||||||
accum->dx += device->x;
|
notify_motion(device, time,
|
||||||
accum->dy += device->y;
|
device->x + accum->dx, device->y + accum->dy);
|
||||||
notify_motion(device, time, accum->dx, accum->dy);
|
|
||||||
accum->dx = accum->dy = 0;
|
|
||||||
}
|
|
||||||
if (accum->type == EVDEV_ABSOLUTE_MOTION)
|
if (accum->type == EVDEV_ABSOLUTE_MOTION)
|
||||||
notify_motion(device, time, accum->x, accum->y);
|
notify_motion(device, time, accum->x, accum->y);
|
||||||
|
|
||||||
accum->type = 0;
|
memset(accum, 0, sizeof *accum);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue