From 098ca89e1744ddf540fef18135bbf43140d8ccb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sun, 10 Nov 2013 00:30:10 +0100 Subject: [PATCH] Make weston_output_transform_coordinate() take wl_fixed_t coordinates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is to make it possible for future API to have non-integer coordinates as input. Signed-off-by: Jonas Ã…dahl --- src/evdev.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index ad7a3f6b..50ce8713 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -103,18 +103,18 @@ evdev_flush_pending_event(struct evdev_device *device, uint32_t time) device->rel.dy = 0; goto handled; case EVDEV_ABSOLUTE_MT_DOWN: + x = wl_fixed_from_int(device->mt.slots[slot].x); + y = wl_fixed_from_int(device->mt.slots[slot].y); weston_output_transform_coordinate(device->output, - device->mt.slots[slot].x, - device->mt.slots[slot].y, - &x, &y); + x, y, &x, &y); notify_touch(master, time, slot, x, y, WL_TOUCH_DOWN); goto handled; case EVDEV_ABSOLUTE_MT_MOTION: + x = wl_fixed_from_int(device->mt.slots[slot].x); + y = wl_fixed_from_int(device->mt.slots[slot].y); weston_output_transform_coordinate(device->output, - device->mt.slots[slot].x, - device->mt.slots[slot].y, - &x, &y); + x, y, &x, &y); notify_touch(master, time, slot, x, y, WL_TOUCH_MOTION); goto handled; @@ -124,14 +124,18 @@ evdev_flush_pending_event(struct evdev_device *device, uint32_t time) goto handled; case EVDEV_ABSOLUTE_TOUCH_DOWN: transform_absolute(device, &cx, &cy); + x = wl_fixed_from_int(cx); + y = wl_fixed_from_int(cy); weston_output_transform_coordinate(device->output, - cx, cy, &x, &y); + x, y, &x, &y); notify_touch(master, time, 0, x, y, WL_TOUCH_DOWN); goto handled; case EVDEV_ABSOLUTE_MOTION: transform_absolute(device, &cx, &cy); + x = wl_fixed_from_int(cx); + y = wl_fixed_from_int(cy); weston_output_transform_coordinate(device->output, - cx, cy, &x, &y); + x, y, &x, &y); if (device->caps & EVDEV_TOUCH) notify_touch(master, time, 0, x, y, WL_TOUCH_MOTION);