Drag.begin

Starts a drag and creates a new drag context for it.

This function is called by the drag source. After this call, you probably want to set up the drag icon using the surface returned by [method@Gdk.Drag.get_drag_surface].

This function returns a reference to the [class@Gdk.Drag] object, but GTK keeps its own reference as well, as long as the DND operation is going on.

Note: if @actions include %GDK_ACTION_MOVE, you need to listen for the [signal@Gdk.Drag::dnd-finished] signal and delete the data at the source if [method@Gdk.Drag.get_selected_action] returns %GDK_ACTION_MOVE.

Parameters

surface Surface

the source surface for this drag

device Device

the device that controls this drag

content ContentProvider

the offered content

actions GdkDragAction

the actions supported by this drag

dx double

the x offset to @device's position where the drag nominally started

dy double

the y offset to @device's position where the drag nominally started

Return Value

Type: Drag

a newly created [class@Gdk.Drag] or %NULL on error

Meta