summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2016-10-25 19:24:49 +0200
committerHans de Goede <hdegoede@redhat.com>2016-10-26 11:51:38 +0200
commit7b135f5e7d79622c0b922de8ee827a2556504d8f (patch)
tree3ae74a5b80f472b185a5b6547eebe55aa16cff50
parent5dd187197d3f0ca75a35db00f0c943ca8927e27c (diff)
xwayland: Transform pointer enter event coordinatesfor-server-1.19
Pointer enter event coordinates are surface relative and we need them to be screen relative for pScreen->SetCursorPosition(). https://bugzilla.gnome.org/show_bug.cgi?id=758283 Signed-off-by: Rui Matos <tiagomatos@gmail.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--hw/xwayland/xwayland-input.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 4d447a5a5..1991076db 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -298,6 +298,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
int i;
int sx = wl_fixed_to_int(sx_w);
int sy = wl_fixed_to_int(sy_w);
+ int dx, dy;
ScreenPtr pScreen = xwl_seat->xwl_screen->screen;
ValuatorMask mask;
@@ -314,9 +315,11 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
xwl_seat->pointer_enter_serial = serial;
xwl_seat->focus_window = wl_surface_get_user_data(surface);
+ dx = xwl_seat->focus_window->window->drawable.x;
+ dy = xwl_seat->focus_window->window->drawable.y;
master = GetMaster(dev, POINTER_OR_FLOAT);
- (*pScreen->SetCursorPosition) (dev, pScreen, sx, sy, TRUE);
+ (*pScreen->SetCursorPosition) (dev, pScreen, dx + sx, dy + sy, TRUE);
miPointerInvalidateSprite(master);