events: Make GdkEventDND have a GdkDrop member

... instead of a GdkDragContext.
This commit is contained in:
Benjamin Otte 2018-05-29 20:49:41 +02:00
parent 81171cc0a2
commit c67fb57881
3 changed files with 9 additions and 10 deletions

View File

@ -594,7 +594,7 @@ gdk_drop_emit_enter_event (GdkDrop *self,
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);
@ -613,7 +613,7 @@ gdk_drop_emit_motion_event (GdkDrop *self,
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;
@ -632,7 +632,7 @@ gdk_drop_emit_leave_event (GdkDrop *self,
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);
@ -651,7 +651,7 @@ gdk_drop_emit_drop_event (GdkDrop *self,
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;

View File

@ -643,7 +643,7 @@ gdk_event_copy (const GdkEvent *event)
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:
@ -714,8 +714,7 @@ gdk_event_finalize (GObject *object)
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:
@ -2077,7 +2076,7 @@ gdk_event_get_drop (const GdkEvent *event)
event->any.type == GDK_DRAG_MOTION ||
event->any.type == GDK_DROP_START)
{
return GDK_DROP (event->dnd.context);
return event->dnd.drop;
}
return NULL;

View File

@ -430,7 +430,7 @@ struct _GdkEventGrabBroken {
* %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.
@ -441,7 +441,7 @@ struct _GdkEventGrabBroken {
*/
struct _GdkEventDND {
GdkEventAny any;
GdkDragContext *context;
GdkDrop *drop;
guint32 time;
gshort x_root, y_root;