## GtkDropControllerMotion GtkDropControllerMotion — Event controller for motion events during a drop |

## Functions

GtkEventController * | gtk_drop_controller_motion_new ()
gboolean | gtk_drop_controller_motion_contains_pointer ()
gboolean | gtk_drop_controller_motion_is_pointer ()
GdkDrop * | gtk_drop_controller_motion_get_drop ()

## Properties

gboolean | contains-pointer | Read
GdkDrop * | drop | Read
gboolean | is-pointer | Read

## Signals

void | enter | Run Last
void | leave | Run Last
void | motion | Run First

## Types and Values

| GtkDropControllerMotion

## Object Hierarchy

        GObject
        ╰── GtkEventController
            ╰── GtkDropControllerMotion

## Includes

    #include <gtk/gtk.h>

## Description

GtkDropControllerMotion is an event controller meant for tracking the pointer hovering over a widget during a drag and drop operation.

It is modeled after GtkEventControllerMotion so if you have used that, this should feel really familiar.

The drop controller is not able to accept drops, use GtkDropTarget for that purpose.

## Functions

### gtk_drop_controller_motion_new ()

    GtkEventController *
    gtk_drop_controller_motion_new (void);

Creates a new event controller that will handle pointer motion events during drag and drop.

#### Returns

a new GtkDropControllerMotion

### gtk_drop_controller_motion_contains_pointer ()

    gboolean
    gtk_drop_controller_motion_contains_pointer
                                   (GtkDropControllerMotion *self);

Returns the value of the GtkDropControllerMotion:contains-pointer property.

#### Parameters

self | a GtkDropControllerMotion |

#### Returns

`TRUE` if a dragging pointer is within `self` or one of its children.

### gtk_drop_controller_motion_is_pointer ()

    gboolean
    gtk_drop_controller_motion_is_pointer (GtkDropControllerMotion *self);

Returns the value of the GtkDropControllerMotion:is-pointer property.

#### Parameters

self | a GtkEventControllerKey |

#### Returns

`TRUE` if a dragging pointer is within `self` but not one of its children

### gtk_drop_controller_motion_get_drop ()

    GdkDrop *
    gtk_drop_controller_motion_get_drop (GtkDropControllerMotion *self);

Returns the value of the GtkDropControllerMotion:drop property.

#### Parameters

self | a GtkDropControllerMotion |

#### Returns

The GdkDrop currently happening within `self` or `NULL` if none.

[transfer none][nullable]

## Types and Values

### GtkDropControllerMotion

    typedef struct _GtkDropControllerMotion GtkDropControllerMotion;

## Property Details

### The `“contains-pointer”` property

      “contains-pointer”         gboolean

Whether the pointer of a drag and drop operation is in the controller's widget or a descendant. See also “is-pointer”.

When handling crossing events, this property is updated before “enter” but after “leave” is emitted.

Owner: GtkDropControllerMotion

Flags: Read

Default value: FALSE

### The `“drop”` property

      “drop”                     GdkDrop *

The ongoing drop operation over the controller's widget or its descendant. If no drop operation is going on, this property returns `NULL`.

The event controller should not modify the `drop` , but it might want to query its properties.

When handling crossing events, this property is updated before “enter” but after “leave” is emitted.

Owner: GtkDropControllerMotion

Flags: Read

### The `“is-pointer”` property

      “is-pointer”               gboolean

Whether the pointer is in the controllers widget itself, as opposed to in a descendent widget. See also “contains-pointer”.

When handling crossing events, this property is updated before “enter” but after “leave” is emitted.

Owner: GtkDropControllerMotion

Flags: Read

Default value: FALSE

## Signal Details

### The `“enter”` signal

    void
    user_function (GtkDropControllerMotion *self,
                   double                   x,
                   double                   y,
                   gpointer                 user_data)

Signals that the pointer has entered the widget.

#### Parameters

self | the object which received the signal |
x | coordinates of pointer location |
y | coordinates of pointer location |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“leave”` signal

    void
    user_function (GtkDropControllerMotion *self,
                   gpointer                 user_data)

Signals that the pointer has left the widget.

#### Parameters

self | the object which received the signal |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“motion”` signal

    void
    user_function (GtkDropControllerMotion *self,
                   double                   x,
                   double                   y,
                   gpointer                 user_data)

Emitted when the pointer moves inside the widget.

#### Parameters

self | The object that received the signal |
x | the x coordinate |
y | the y coordinate |
user_data | user data set when the signal handler was connected. |

Flags: Run First

## See Also

GtkDropControllerMotion, GdkDrop, GtkDropTarget