wayland: Ensure harder we're dealing with DnD offers/sources

In destroy_data_offer() there is code to ensure compatibility when
dragging from a v3 wl_data_device to a v2 one, it's however not checking
correctly that this is the DnD drag source. The other path should be
used otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=762878
This commit is contained in:
Carlos Garnacho 2016-02-29 16:44:39 +01:00
parent 66be0387ee
commit 43bd057754

View File

@ -492,12 +492,16 @@ static void
destroy_data_offer (struct wl_resource *resource) destroy_data_offer (struct wl_resource *resource)
{ {
MetaWaylandDataOffer *offer = wl_resource_get_user_data (resource); MetaWaylandDataOffer *offer = wl_resource_get_user_data (resource);
MetaWaylandSeat *seat;
if (offer->source) if (offer->source)
{ {
seat = meta_wayland_data_source_get_seat (offer->source);
if (offer == meta_wayland_data_source_get_current_offer (offer->source)) if (offer == meta_wayland_data_source_get_current_offer (offer->source))
{ {
if (wl_resource_get_version (offer->resource) < if (seat && seat->data_device.dnd_data_source == offer->source &&
wl_resource_get_version (offer->resource) <
WL_DATA_OFFER_ACTION_SINCE_VERSION) WL_DATA_OFFER_ACTION_SINCE_VERSION)
meta_wayland_data_source_notify_finish (offer->source); meta_wayland_data_source_notify_finish (offer->source);
else else