Commit f68ba7b8 authored by Rui Tiago Matos's avatar Rui Tiago Matos Committed by Adam Jackson

xwayland: Transform pointer enter event coordinates

Pointer enter event coordinates are surface relative and we need them to
be screen relative for pScreen->SetCursorPosition(). Rui Tiago Matos's avatarRui Matos <>
Reviewed-by: Eric Engestrom's avatarEric Engestrom <>
Reviewed-by: Jonas Ådahl's avatarJonas Ådahl <>
Signed-off-by: default avatarHans de Goede <>
parent f5c6d751
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment