event = gdk_event_new (GDK_DRAG_ENTER);
event->any.surface = g_object_ref (priv->surface);
- event->dnd.context = (GdkDragContext *) g_object_ref (self);
+ event->dnd.drop = g_object_ref (self);
event->dnd.time = time;
gdk_event_set_device (event, priv->device);
event = gdk_event_new (GDK_DRAG_MOTION);
event->any.surface = g_object_ref (priv->surface);
- event->dnd.context = (GdkDragContext *) g_object_ref (self);
+ event->dnd.drop = g_object_ref (self);
event->dnd.time = time;
event->dnd.x_root = x_root;
event->dnd.y_root = y_root;
event = gdk_event_new (GDK_DRAG_LEAVE);
event->any.surface = g_object_ref (priv->surface);
- event->dnd.context = (GdkDragContext *) g_object_ref (self);
+ event->dnd.drop = g_object_ref (self);
event->dnd.time = time;
gdk_event_set_device (event, priv->device);
event = gdk_event_new (GDK_DROP_START);
event->any.surface = g_object_ref (priv->surface);
- event->dnd.context = (GdkDragContext *) g_object_ref (self);
+ event->dnd.drop = g_object_ref (self);
event->dnd.time = time;
event->dnd.x_root = x_root;
event->dnd.y_root = y_root;
case GDK_DRAG_LEAVE:
case GDK_DRAG_MOTION:
case GDK_DROP_START:
- g_object_ref (event->dnd.context);
+ g_object_ref (event->dnd.drop);
break;
case GDK_EXPOSE:
case GDK_DRAG_LEAVE:
case GDK_DRAG_MOTION:
case GDK_DROP_START:
- if (event->dnd.context != NULL)
- g_object_unref (event->dnd.context);
+ g_clear_object (&event->dnd.drop);
break;
case GDK_BUTTON_PRESS:
event->any.type == GDK_DRAG_MOTION ||
event->any.type == GDK_DROP_START)
{
- return GDK_DROP (event->dnd.context);
+ return event->dnd.drop;
}
return NULL;
* %GDK_DRAG_MOTION or %GDK_DROP_START)
* @surface: the surface which received the event.
* @send_event: %TRUE if the event was sent explicitly.
- * @context: the #GdkDragContext for the current DND operation.
+ * @drop: the #GdkDrop for the current DND operation.
* @time: the time of the event in milliseconds.
* @x_root: the x coordinate of the pointer relative to the root of the
* screen, only set for %GDK_DRAG_MOTION and %GDK_DROP_START.
*/
struct _GdkEventDND {
GdkEventAny any;
- GdkDragContext *context;
+ GdkDrop *drop;
guint32 time;
gshort x_root, y_root;