The ::drag-data-received signal is emitted on the drop site when the
dragged data has been received. If the data was received in order to
determine whether the drop will be accepted, the handler is expected
to call gdk_drag_status() and not finish the drag.
If the data was received in response to a drag-drop signal
(and this is the last target to be received), the handler for this
signal is expected to process the received data and then call
gtk_drag_finish(), setting the success parameter depending on
whether the data was processed successfully.
Applications must create some means to determine why the signal was emitted
and therefore whether to call gdk_drag_status() or gtk_drag_finish().
The handler may inspect the selected action with
DragContext.getSelectedAction before calling
gtk_drag_finish(), e.g. to implement GDK_ACTION_ASK as
shown in the following example:
The ::drag-data-received signal is emitted on the drop site when the dragged data has been received. If the data was received in order to determine whether the drop will be accepted, the handler is expected to call gdk_drag_status() and not finish the drag. If the data was received in response to a drag-drop signal (and this is the last target to be received), the handler for this signal is expected to process the received data and then call gtk_drag_finish(), setting the success parameter depending on whether the data was processed successfully.
Applications must create some means to determine why the signal was emitted and therefore whether to call gdk_drag_status() or gtk_drag_finish().
The handler may inspect the selected action with DragContext.getSelectedAction before calling gtk_drag_finish(), e.g. to implement GDK_ACTION_ASK as shown in the following example: