[gtk/fix-dnd: 1/3] gdk: Fix coordinates in dnd events



commit 677c4b140ce6ad22726c6e3c39b56f27674989dd
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Dec 30 11:56:49 2019 -0500

    gdk: Fix coordinates in dnd events
    
    Don't store coordinates as shorts. Use doubles,
    as everywhere else. Also add x, y in addition
    to x_root, y_root, and actually return those
    in gdk_event_get_coords.

 gdk/gdkevents.c        | 7 +++++++
 gdk/gdkeventsprivate.h | 4 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index bf978e2980..27c7501bd3 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -947,6 +947,13 @@ gdk_event_get_coords (const GdkEvent *event,
       x = event->touchpad_pinch.x;
       y = event->touchpad_pinch.y;
       break;
+    case GDK_DRAG_ENTER:
+    case GDK_DRAG_LEAVE:
+    case GDK_DRAG_MOTION:
+    case GDK_DROP_START:
+      x = event->dnd.x;
+      y = event->dnd.y;
+      break;
     default:
       fetched = FALSE;
       break;
diff --git a/gdk/gdkeventsprivate.h b/gdk/gdkeventsprivate.h
index eefc1f4622..fe9b80a7f8 100644
--- a/gdk/gdkeventsprivate.h
+++ b/gdk/gdkeventsprivate.h
@@ -418,7 +418,9 @@ struct _GdkEventDND {
   GdkDrop *drop;
 
   guint32 time;
-  gshort x_root, y_root;
+  double x_root, y_root;
+  double x;
+  double y;
 };
 
 /*


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