[gtk/readonly-events-1: 9/49] gdk: Use event constructors for dnd



commit 6718c572812c82f3999d099ec6a430102802f6ae
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Feb 15 09:36:19 2020 -0500

    gdk: Use event constructors for dnd

 gdk/gdkdrop.c | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/gdk/gdkdrop.c b/gdk/gdkdrop.c
index f4a5b27916..a9a7c2eb79 100644
--- a/gdk/gdkdrop.c
+++ b/gdk/gdkdrop.c
@@ -923,11 +923,12 @@ gdk_drop_emit_enter_event (GdkDrop  *self,
   GdkDropPrivate *priv = gdk_drop_get_instance_private (self);
   GdkEvent *event;
 
-  event = gdk_event_new (GDK_DRAG_ENTER);
-  event->any.surface = g_object_ref (priv->surface);
-  event->dnd.drop = g_object_ref (self);
-  event->dnd.time = time;
-  gdk_event_set_device (event, priv->device);
+  event = gdk_event_drag_new (GDK_DRAG_ENTER,
+                              priv->surface,
+                              priv->device,
+                              self,
+                              time,
+                              0, 0);
 
   gdk_drop_do_emit_event (event, dont_queue);
 }
@@ -942,13 +943,12 @@ gdk_drop_emit_motion_event (GdkDrop  *self,
   GdkDropPrivate *priv = gdk_drop_get_instance_private (self);
   GdkEvent *event;
 
-  event = gdk_event_new (GDK_DRAG_MOTION);
-  event->any.surface = g_object_ref (priv->surface);
-  event->dnd.drop = g_object_ref (self);
-  event->dnd.time = time;
-  event->dnd.x = x;
-  event->dnd.y = y;
-  gdk_event_set_device (event, priv->device);
+  event = gdk_event_drag_new (GDK_DRAG_MOTION,
+                              priv->surface,
+                              priv->device,
+                              self,
+                              time,
+                              x, y);
 
   gdk_drop_do_emit_event (event, dont_queue);
 }
@@ -961,11 +961,12 @@ gdk_drop_emit_leave_event (GdkDrop  *self,
   GdkDropPrivate *priv = gdk_drop_get_instance_private (self);
   GdkEvent *event;
 
-  event = gdk_event_new (GDK_DRAG_LEAVE);
-  event->any.surface = g_object_ref (priv->surface);
-  event->dnd.drop = g_object_ref (self);
-  event->dnd.time = time;
-  gdk_event_set_device (event, priv->device);
+  event = gdk_event_drag_new (GDK_DRAG_LEAVE,
+                              priv->surface,
+                              priv->device,
+                              self,
+                              time,
+                              0, 0);
 
   gdk_drop_do_emit_event (event, dont_queue);
 }
@@ -980,13 +981,12 @@ gdk_drop_emit_drop_event (GdkDrop  *self,
   GdkDropPrivate *priv = gdk_drop_get_instance_private (self);
   GdkEvent *event;
 
-  event = gdk_event_new (GDK_DROP_START);
-  event->any.surface = g_object_ref (priv->surface);
-  event->dnd.drop = g_object_ref (self);
-  event->dnd.time = time;
-  event->dnd.x = x;
-  event->dnd.y = y;
-  gdk_event_set_device (event, priv->device);
+  event = gdk_event_drag_new (GDK_DROP_START,
+                              priv->surface,
+                              priv->device,
+                              self,
+                              time,
+                              x, y);
 
   gdk_drop_do_emit_event (event, dont_queue);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]