From db0fa54b5aca46cbf4c641eda9ac8a683ee22624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 22 Nov 2011 19:24:25 -0500 Subject: [PATCH] Simplify evdev_flush_motion() a tiny bit --- compositor/evdev.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/compositor/evdev.c b/compositor/evdev.c index 06913cf4..d36c9b4e 100644 --- a/compositor/evdev.c +++ b/compositor/evdev.c @@ -207,16 +207,13 @@ static void evdev_flush_motion(struct wl_input_device *device, uint32_t time, struct evdev_motion_accumulator *accum) { - if (accum->type == EVDEV_RELATIVE_MOTION) { - accum->dx += device->x; - accum->dy += device->y; - notify_motion(device, time, accum->dx, accum->dy); - accum->dx = accum->dy = 0; - } + if (accum->type == EVDEV_RELATIVE_MOTION) + notify_motion(device, time, + device->x + accum->dx, device->y + accum->dy); if (accum->type == EVDEV_ABSOLUTE_MOTION) notify_motion(device, time, accum->x, accum->y); - accum->type = 0; + memset(accum, 0, sizeof *accum); } static int