From 40e44ab18db1987da7f2f49683496d81bde66d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 7 May 2013 20:50:26 -0400 Subject: [PATCH] data-device: Fix dnd regression from weston_seat rewrite We had a drag_surface in wl_seat and weston_seat which confused me during the rewrite. --- src/data-device.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data-device.c b/src/data-device.c index 9352e45b..c4f8e3d8 100644 --- a/src/data-device.c +++ b/src/data-device.c @@ -233,16 +233,16 @@ weston_seat_update_drag_surface(struct weston_seat *seat, int dx, int dy) { int surface_changed = 0; - if (!seat->drag_surface && !seat->drag_surface) + if (!seat->drag_surface && !seat->next_drag_surface) return; - if (seat->drag_surface && seat->drag_surface && + if (seat->drag_surface && seat->next_drag_surface && (&seat->drag_surface->surface.resource != &seat->next_drag_surface->resource)) /* between calls to this funcion we got a new drag_surface */ surface_changed = 1; - if (!seat->drag_surface || surface_changed) { + if (!seat->next_drag_surface || surface_changed) { device_release_drag_surface(seat); if (!surface_changed) return; @@ -250,7 +250,7 @@ weston_seat_update_drag_surface(struct weston_seat *seat, int dx, int dy) if (!seat->drag_surface || surface_changed) { struct weston_surface *surface = - (struct weston_surface *) seat->drag_surface; + (struct weston_surface *) seat->next_drag_surface; if (!device_setup_new_drag_surface(seat, surface)) return; } @@ -348,7 +348,7 @@ static void data_device_end_drag_grab(struct weston_seat *seat) { if (seat->drag_surface) { - seat->drag_surface = NULL; + seat->next_drag_surface = NULL; weston_seat_update_drag_surface(seat, 0, 0); wl_list_remove(&seat->drag_icon_listener.link); }