wayland: Do not check current offer on DnD button release

This check was added on commit 48639ac5 as a means to disregard
DnD drops where the offer would disappear beforehand. However since
that commit was all about wl_data_device_manager version < 3,
forgetting about the selected mimetype seems a behavior more inline
with those versions.

Since no current drop is something expected on X11 drop sites, fixes
DnD over those, while keeping the original bug fixed.

Found by Robert Mader (https://gitlab.gnome.org/GNOME/mutter/issues/974#note_688144)

https://gitlab.gnome.org/GNOME/mutter/issues/974
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1005

(cherry picked from commit 30bf588a38)
This commit is contained in:
Carlos Garnacho 2020-01-17 19:36:54 +01:00 committed by Robert Mader
parent 21dca32934
commit 5ae317e004

View File

@ -569,9 +569,14 @@ destroy_data_offer (struct wl_resource *resource)
if (seat->data_device.dnd_data_source == offer->source && if (seat->data_device.dnd_data_source == offer->source &&
wl_resource_get_version (offer->resource) < 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
meta_wayland_data_source_set_current_offer (offer->source, NULL); {
meta_wayland_data_source_set_current_offer (offer->source, NULL);
meta_wayland_data_source_set_has_target (offer->source, FALSE);
}
} }
g_object_remove_weak_pointer (G_OBJECT (offer->source), g_object_remove_weak_pointer (G_OBJECT (offer->source),
@ -1031,7 +1036,6 @@ drag_grab_button (MetaWaylandPointerGrab *grab,
gboolean success; gboolean success;
if (drag_grab->drag_focus && source && if (drag_grab->drag_focus && source &&
meta_wayland_data_source_get_current_offer (source) &&
meta_wayland_data_source_has_target (source) && meta_wayland_data_source_has_target (source) &&
meta_wayland_data_source_get_current_action (source)) meta_wayland_data_source_get_current_action (source))
{ {