From 3ffaf3d79bddab73bd001ee6e27bbbebadd4c9b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 9 May 2012 12:19:04 -0400 Subject: [PATCH] compositor: Use wl_fixed_t for incoming input events This changes notify_motion, notify_pointer_focus and notify_touch to take wl_fixed_t types for input coordinates. --- src/evdev.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 5fa7ae6..4dbf575 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -300,8 +300,8 @@ evdev_flush_motion(struct evdev_input_device *device, uint32_t time) if (device->type & EVDEV_RELATIVE_MOTION) { notify_motion(master, time, - wl_fixed_to_int(master->x) + device->rel.dx, - wl_fixed_to_int(master->y) + device->rel.dy); + master->x + wl_fixed_from_int(device->rel.dx), + master->y + wl_fixed_from_int(device->rel.dy)); device->type &= ~EVDEV_RELATIVE_MOTION; device->rel.dx = 0; device->rel.dy = 0; @@ -309,8 +309,8 @@ evdev_flush_motion(struct evdev_input_device *device, uint32_t time) if (device->type & EVDEV_ABSOLUTE_MT_DOWN) { notify_touch(master, time, device->mt.slot, - device->mt.x[device->mt.slot], - device->mt.y[device->mt.slot], + wl_fixed_from_int(device->mt.x[device->mt.slot]), + wl_fixed_from_int(device->mt.y[device->mt.slot]), WL_INPUT_DEVICE_TOUCH_DOWN); device->type &= ~EVDEV_ABSOLUTE_MT_DOWN; device->type &= ~EVDEV_ABSOLUTE_MT_MOTION; @@ -318,8 +318,8 @@ evdev_flush_motion(struct evdev_input_device *device, uint32_t time) if (device->type & EVDEV_ABSOLUTE_MT_MOTION) { notify_touch(master, time, device->mt.slot, - device->mt.x[device->mt.slot], - device->mt.y[device->mt.slot], + wl_fixed_from_int(device->mt.x[device->mt.slot]), + wl_fixed_from_int(device->mt.y[device->mt.slot]), WL_INPUT_DEVICE_TOUCH_MOTION); device->type &= ~EVDEV_ABSOLUTE_MT_DOWN; device->type &= ~EVDEV_ABSOLUTE_MT_MOTION; @@ -330,7 +330,9 @@ evdev_flush_motion(struct evdev_input_device *device, uint32_t time) device->type &= ~EVDEV_ABSOLUTE_MT_UP; } if (device->type & EVDEV_ABSOLUTE_MOTION) { - notify_motion(master, time, device->abs.x, device->abs.y); + notify_motion(master, time, + wl_fixed_from_int(device->abs.x), + wl_fixed_from_int(device->abs.y)); device->type &= ~EVDEV_ABSOLUTE_MOTION; } } -- 2.7.4