Bug 1884243 [Wayland] Flip GTK_DRAG_RESULT_ERROR to GTK_DRAG_RESULT_NO_TARGET on Wayland as Gecko expects it r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D211189
This commit is contained in:
stransky 2024-05-22 18:11:45 +00:00
parent 377f0388d1
commit 46acdfb552

View file

@ -2460,16 +2460,10 @@ static gboolean invisibleSourceDragFailed(GtkWidget* aWidget,
// GDK_DRAG_CANCEL_ERROR error code
// (see data_source_cancelled/gdkselection-wayland.c).
// Bug 1527976
// Emulate what X11 does here as Gecko expect it and handles NO_TARGET
// result correctly according to drop destination.
if (widget::GdkIsWaylandDisplay() && aResult == GTK_DRAG_RESULT_ERROR) {
for (GList* tmp = gdk_drag_context_list_targets(aContext); tmp;
tmp = tmp->next) {
if (nsDragService::sTabDropTypeAtom == GDK_POINTER_TO_ATOM(tmp->data)) {
aResult = GTK_DRAG_RESULT_NO_TARGET;
LOGDRAGSERVICESTATIC("invisibleSourceDragFailed(%p): Wayland tab drop",
aContext);
break;
}
}
aResult = GTK_DRAG_RESULT_NO_TARGET;
}
LOGDRAGSERVICESTATIC("invisibleSourceDragFailed(%p) %s", aContext,