[PATCH xwayland 3/3] xwayland: fix pointer enter/leave

Kristian Høgsberg hoegsberg at gmail.com
Mon May 7 07:05:06 PDT 2012


On Mon, May 07, 2012 at 03:04:59PM +0300, Tiago Vignatti wrote:

Thanks, that looks better.

Kristian

> Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
> ---
>  hw/xfree86/xwayland/xwayland-input.c |   16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/hw/xfree86/xwayland/xwayland-input.c b/hw/xfree86/xwayland/xwayland-input.c
> index 79def3b..7cc7a1f 100644
> --- a/hw/xfree86/xwayland/xwayland-input.c
> +++ b/hw/xfree86/xwayland/xwayland-input.c
> @@ -353,17 +353,10 @@ input_device_handle_pointer_enter(void *data,
>      xwl_input_device->xwl_screen->serial = serial;
>      xwl_input_device->pointer_enter_serial = serial;
>  
> -    if (surface)
> -	xwl_input_device->focus_window = wl_surface_get_user_data(surface);
> -    else
> -	xwl_input_device->focus_window = NULL;
> +    xwl_input_device->focus_window = wl_surface_get_user_data(surface);
>  
> -    if (xwl_input_device->focus_window)
> -	SetDeviceRedirectWindow(xwl_input_device->pointer,
> -				xwl_input_device->focus_window->window);
> -    else
> -	SetDeviceRedirectWindow(xwl_input_device->pointer,
> -				PointerRootWin);
> +    SetDeviceRedirectWindow(xwl_input_device->pointer,
> +                            xwl_input_device->focus_window->window);
>  }
>  
>  static void
> @@ -414,6 +407,9 @@ input_device_handle_pointer_leave(void *data,
>      struct xwl_input_device *xwl_input_device = data;
>  
>      xwl_input_device->xwl_screen->serial = serial;
> +
> +    xwl_input_device->focus_window = NULL;
> +    SetDeviceRedirectWindow(xwl_input_device->pointer, PointerRootWin);
>  }
>  
>  static void
> -- 
> 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