data-device: Don't fake an attach event on drag icon surface

Emit a new drag icon signal instead and let the compositor handle the
unmapping of the icon surface.
This commit is contained in:
Ander Conselvan de Oliveira 2012-10-11 14:05:37 +03:00 committed by Kristian Høgsberg
parent ae8d4b59a4
commit 0a27ce1fc2

View file

@ -228,16 +228,9 @@ drag_grab_motion(struct wl_pointer_grab *grab,
static void static void
data_device_end_drag_grab(struct wl_seat *seat) data_device_end_drag_grab(struct wl_seat *seat)
{ {
struct wl_resource *surface_resource;
struct wl_surface_interface *implementation;
if (seat->drag_surface) { if (seat->drag_surface) {
surface_resource = &seat->drag_surface->resource; seat->drag_surface = NULL;
implementation = (struct wl_surface_interface *) wl_signal_emit(&seat->drag_icon_signal, NULL);
surface_resource->object.implementation;
implementation->attach(surface_resource->client,
surface_resource, NULL, 0, 0);
wl_list_remove(&seat->drag_icon_listener.link); 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); wl_pointer_end_grab(seat->pointer);
seat->drag_data_source = NULL; seat->drag_data_source = NULL;
seat->drag_surface = NULL;
seat->drag_client = NULL; seat->drag_client = NULL;
} }