Skip to content

app: Avoid double gtk_drag_finish() call on GimpToolbox

According to the ::drag-drop GTK documentation: "The call to gtk_drag_finish() can be done either directly or in a “drag-data-received” handler which gets triggered by calling gtk_drag_get_data()"

The GimpToolbox's vbox handling DnD chooses however to do both, the drag-drop handler is calling gtk_drag_get_data() and invariably calling gtk_drag_finish() to hint that the DnD operation is ending. While this worked in practice in X11, This is a harder either/or in Wayland resulting in the transfer being cancelled.

In order to behave better wrt the documentation, and make DnD into the toolbox work on both X11 and Wayland, avoid the first gtk_drag_finish() if the data is being requested, and only bail out if no offered target matches what the widget can handle. The handling done indirectly through gimp_toolbox_dnd_init() and gimp_dnd_*_dest_add() will take care of finalizing the DnD data transfers successfully.

Closes: #7373 (closed)

Merge request reports