input: use doubles in the interfaces to notify of input events
This patch is a further step in the wl_fixed_t internal sanitization.
It changes the notify_* functions to take doubles instead of wl_fixed_t
but does not change how these are stored in the various input structs
yet, except for weston_pointer_axis_event.
However this already allows to remove all wl_fixed_t usage in places
like the libinput or the x11 backend.
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/src/libinput-device.c b/src/libinput-device.c
index f8b614a..c5d3fd1 100644
--- a/src/libinput-device.c
+++ b/src/libinput-device.c
@@ -109,7 +109,7 @@
libinput_device_get_user_data(libinput_device);
struct weston_output *output = device->output;
uint32_t time;
- wl_fixed_t x, y;
+ double x, y;
uint32_t width, height;
if (!output)
@@ -119,12 +119,10 @@
width = device->output->current_mode->width;
height = device->output->current_mode->height;
- x = wl_fixed_from_double(
- libinput_event_pointer_get_absolute_x_transformed(pointer_event,
- width));
- y = wl_fixed_from_double(
- libinput_event_pointer_get_absolute_y_transformed(pointer_event,
- height));
+ x = libinput_event_pointer_get_absolute_x_transformed(pointer_event,
+ width);
+ y = libinput_event_pointer_get_absolute_y_transformed(pointer_event,
+ height);
weston_output_transform_coordinate(device->output, x, y, &x, &y);
notify_motion_absolute(device->seat, time, x, y);
@@ -252,7 +250,7 @@
vert = normalize_scroll(pointer_event, axis);
weston_event.axis = WL_POINTER_AXIS_VERTICAL_SCROLL;
- weston_event.value = wl_fixed_from_double(vert);
+ weston_event.value = vert;
weston_event.discrete = vert_discrete;
weston_event.has_discrete = (vert_discrete != 0);
@@ -267,7 +265,7 @@
horiz = normalize_scroll(pointer_event, axis);
weston_event.axis = WL_POINTER_AXIS_HORIZONTAL_SCROLL;
- weston_event.value = wl_fixed_from_double(horiz);
+ weston_event.value = horiz;
weston_event.discrete = horiz_discrete;
weston_event.has_discrete = (horiz_discrete != 0);
@@ -286,8 +284,8 @@
{
struct evdev_device *device =
libinput_device_get_user_data(libinput_device);
- wl_fixed_t x;
- wl_fixed_t y;
+ double x;
+ double y;
uint32_t width, height;
uint32_t time;
int32_t slot;
@@ -300,10 +298,8 @@
width = device->output->current_mode->width;
height = device->output->current_mode->height;
- x = wl_fixed_from_double(
- libinput_event_touch_get_x_transformed(touch_event, width));
- y = wl_fixed_from_double(
- libinput_event_touch_get_y_transformed(touch_event, height));
+ x = libinput_event_touch_get_x_transformed(touch_event, width);
+ y = libinput_event_touch_get_y_transformed(touch_event, height);
weston_output_transform_coordinate(device->output,
x, y, &x, &y);