[PATCH weston] compositor-x11: Fix pointer warping with multiple outputs

Ondřej Majerech majerech.o at gmail.com
Fri Mar 20 15:17:30 PDT 2015


When using the X11 backend with multiple outputs, moving the mouse from
one output to another would cause it to warp back to the edge of the
first output.

This was caused by the backend reporting motion events relative to each
respective output, without taking the output's offset into account.

Signed-off-by: Ondřej Majerech <majerech.o at gmail.com>
---
 src/compositor-x11.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index e9735c5..5092a4a 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -1095,10 +1095,11 @@ x11_compositor_deliver_motion_event(struct x11_compositor *c,
 	if (!output)
 		return;
 
-	weston_output_transform_coordinate(&output->base,
-					   wl_fixed_from_int(motion_notify->event_x),
-					   wl_fixed_from_int(motion_notify->event_y),
-					   &x, &y);
+	weston_output_transform_coordinate(
+		&output->base,
+		wl_fixed_from_int(motion_notify->event_x + output->base.x),
+		wl_fixed_from_int(motion_notify->event_y + output->base.y),
+		&x, &y);
 
 	notify_motion(&c->core_seat, weston_compositor_get_time(),
 		      x - c->prev_x, y - c->prev_y);
-- 
2.1.0



More information about the wayland-devel mailing list