Re: [PATCH xserver] xwayland: Transform pointer enter event coordinates
On Tue, Oct 25, 2016 at 07:24:49PM +0200, Rui Matos wrote: > 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 MatosReviewed-by: Jonas Ådahl > --- > hw/xwayland/xwayland-input.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c > index f2327dc..1352197 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); > > -- > 2.9.3 > > ___ > xorg-devel@lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: https://lists.x.org/mailman/listinfo/xorg-devel ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver] xwayland: Transform pointer enter event coordinates
On Tuesday, 2016-10-25 19:24:49 +0200, Rui Matos wrote: > 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 MatosLGTM :) Reviewed-by: Eric Engestrom > --- > hw/xwayland/xwayland-input.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c > index f2327dc..1352197 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); > > -- > 2.9.3 > ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver] xwayland: Transform pointer enter event coordinates
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--- hw/xwayland/xwayland-input.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index f2327dc..1352197 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); -- 2.9.3 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel