[PATCH v2 xserver] xwayland: fix EnterNotify position

Kristian Høgsberg hoegsberg at gmail.com
Mon Jul 16 08:36:36 PDT 2012


On Mon, Jul 16, 2012 at 05:12:24PM +0300, Tiago Vignatti wrote:
> enter handler wasn't updating sprite coordinates based on the Wayland event
> just sent, failing when forwarding the correct EnterNotify to the X client.
> 
> There was a doubt regarding whether ProcessInputEvents should be called just
> after SetCursorPosition or not in order to dequeue the event. When the cursor
> is in motion it obviously will trigger PIE, so to verify it without moving I
> used the switcher binding (mod + tab), so the cursor would enter another
> (frame) window that was unmapped, change to the right cursor and PIE would
> have to be triggered right after. In fact that was the case and I simply
> assumed a direct call to PIE wasn't really needed there.

Very nice fix, thanks.
Kristian


> Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
> ---
> v2: use SetCursorPosition instead touch the pointers values directly.
> 
>  hw/xfree86/xwayland/xwayland-input.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/hw/xfree86/xwayland/xwayland-input.c b/hw/xfree86/xwayland/xwayland-input.c
> index a06cf20..b129fae 100644
> --- a/hw/xfree86/xwayland/xwayland-input.c
> +++ b/hw/xfree86/xwayland/xwayland-input.c
> @@ -268,12 +268,17 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
>      struct xwl_seat *xwl_seat = data;
>      DeviceIntPtr dev = xwl_seat->pointer;
>      int i;
> +    int sx = wl_fixed_to_int(sx_w);
> +    int sy = wl_fixed_to_int(sy_w);
> +    ScreenPtr pScreen = xwl_seat->xwl_screen->screen;
>  
>      xwl_seat->xwl_screen->serial = serial;
>      xwl_seat->pointer_enter_serial = serial;
>  
>      xwl_seat->focus_window = wl_surface_get_user_data(surface);
>  
> +    (*pScreen->SetCursorPosition) (dev, pScreen, sx, sy, TRUE);
> +
>      SetDeviceRedirectWindow(xwl_seat->pointer, xwl_seat->focus_window->window);
>  
>      /* Ideally, X clients shouldn't see these button releases.  When
> -- 
> 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