mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 18:30:08 +00:00
events: Make GdkEventDND have a GdkDrop member
... instead of a GdkDragContext.
This commit is contained in:
parent
81171cc0a2
commit
c67fb57881
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user