aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/libinput/pointer.c5
-rw-r--r--backend/wayland/wl_seat.c6
-rw-r--r--backend/x11/backend.c12
3 files changed, 8 insertions, 15 deletions
diff --git a/backend/libinput/pointer.c b/backend/libinput/pointer.c
index 8a31d312..9ccda634 100644
--- a/backend/libinput/pointer.c
+++ b/backend/libinput/pointer.c
@@ -53,9 +53,8 @@ void handle_pointer_motion_abs(struct libinput_event *event,
wlr_event.device = wlr_dev;
wlr_event.time_msec =
usec_to_msec(libinput_event_pointer_get_time_usec(pevent));
- wlr_event.x_mm = libinput_event_pointer_get_absolute_x(pevent);
- wlr_event.y_mm = libinput_event_pointer_get_absolute_y(pevent);
- libinput_device_get_size(libinput_dev, &wlr_event.width_mm, &wlr_event.height_mm);
+ wlr_event.x = libinput_event_pointer_get_absolute_x_transformed(pevent, 1);
+ wlr_event.y = libinput_event_pointer_get_absolute_y_transformed(pevent, 1);
wlr_signal_emit_safe(&wlr_dev->pointer->events.motion_absolute, &wlr_event);
}
diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c
index 6ca59130..2d4f76de 100644
--- a/backend/wayland/wl_seat.c
+++ b/backend/wayland/wl_seat.c
@@ -80,10 +80,8 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
struct wlr_event_pointer_motion_absolute wlr_event;
wlr_event.device = dev;
wlr_event.time_msec = time;
- wlr_event.width_mm = layout_box.width;
- wlr_event.height_mm = layout_box.height;
- wlr_event.x_mm = transformed.x + wlr_output->lx - layout_box.x;
- wlr_event.y_mm = transformed.y + wlr_output->ly - layout_box.y;
+ wlr_event.x = transformed.x / layout_box.width;
+ wlr_event.y = transformed.y / layout_box.height;
wlr_signal_emit_safe(&dev->pointer->events.motion_absolute, &wlr_event);
}
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index 36d72d9e..f534676d 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -108,10 +108,8 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e
struct wlr_event_pointer_motion_absolute abs = {
.device = &x11->pointer_dev,
.time_msec = ev->time,
- .x_mm = ev->event_x,
- .y_mm = ev->event_y,
- .width_mm = output->wlr_output.width,
- .height_mm = output->wlr_output.height,
+ .x = (double)ev->event_x / output->wlr_output.width,
+ .y = (double)ev->event_y / output->wlr_output.height,
};
wlr_signal_emit_safe(&x11->pointer.events.motion_absolute, &abs);
@@ -136,10 +134,8 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e
struct wlr_event_pointer_motion_absolute abs = {
.device = &x11->pointer_dev,
.time_msec = x11->time,
- .x_mm = pointer->root_x,
- .y_mm = pointer->root_y,
- .width_mm = output->wlr_output.width,
- .height_mm = output->wlr_output.height,
+ .x = (double)pointer->root_x / output->wlr_output.width,
+ .y = (double)pointer->root_y / output->wlr_output.height,
};
wlr_signal_emit_safe(&x11->pointer.events.motion_absolute, &abs);