[PATCH wayland] data-device: Don't fake an attach event on drag icon surface

Kristian Høgsberg hoegsberg at gmail.com
Thu Oct 11 06:47:19 PDT 2012


On Thu, Oct 11, 2012 at 02:05:37PM +0300, Ander Conselvan de Oliveira wrote:
> Emit a new drag icon signal instead and let the compositor handle the
> unmapping of the icon surface.

Much better, I never liked calling back into the protocol handler.

Kristian

> ---
>  src/data-device.c |   12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/src/data-device.c b/src/data-device.c
> index 82020af..363a90d 100644
> --- a/src/data-device.c
> +++ b/src/data-device.c
> @@ -228,16 +228,9 @@ drag_grab_motion(struct wl_pointer_grab *grab,
>  static void
>  data_device_end_drag_grab(struct wl_seat *seat)
>  {
> -	struct wl_resource *surface_resource;
> -	struct wl_surface_interface *implementation;
> -
>  	if (seat->drag_surface) {
> -		surface_resource = &seat->drag_surface->resource;
> -		implementation = (struct wl_surface_interface *)
> -			surface_resource->object.implementation;
> -
> -		implementation->attach(surface_resource->client,
> -				       surface_resource, NULL, 0, 0);
> +		seat->drag_surface = NULL;
> +		wl_signal_emit(&seat->drag_icon_signal, NULL);
>  		wl_list_remove(&seat->drag_icon_listener.link);
>  	}
>  
> @@ -247,7 +240,6 @@ data_device_end_drag_grab(struct wl_seat *seat)
>  	wl_pointer_end_grab(seat->pointer);
>  
>  	seat->drag_data_source = NULL;
> -	seat->drag_surface = NULL;
>  	seat->drag_client = NULL;
>  }
>  
> -- 
> 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