[PATCH xserver 2/2] xwayland: fix motion coordinates

Kristian Høgsberg hoegsberg at gmail.com
Tue Jul 31 19:34:04 PDT 2012


On Tue, Jul 31, 2012 at 03:46:12PM +0300, Tiago Vignatti wrote:
> clients were getting one pixel shifted on each axis.

Why is this off-by-one?

Kristian

> Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
> ---
>  hw/xfree86/xwayland/xwayland-input.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/xfree86/xwayland/xwayland-input.c b/hw/xfree86/xwayland/xwayland-input.c
> index d9f352f..e31fbec 100644
> --- a/hw/xfree86/xwayland/xwayland-input.c
> +++ b/hw/xfree86/xwayland/xwayland-input.c
> @@ -326,8 +326,8 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer,
>      if (!xwl_seat->focus_window)
>  	return ;
>  
> -    dx = xwl_seat->focus_window->window->drawable.x;
> -    dy = xwl_seat->focus_window->window->drawable.y;
> +    dx = xwl_seat->focus_window->window->drawable.x + 1;
> +    dy = xwl_seat->focus_window->window->drawable.y + 1;
>  
>      lx = xf86ScaleAxis(sx + dx, 0xFFFF, 0, xwl_screen->scrninfo->virtualX, 0);
>      ly = xf86ScaleAxis(sy + dy, 0xFFFF, 0, xwl_screen->scrninfo->virtualY, 0);
> -- 
> 1.7.9.5
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list