gdk: Fix coordinates in dnd events
authorMatthias Clasen <mclasen@redhat.com>
Mon, 30 Dec 2019 16:56:49 +0000 (11:56 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 30 Dec 2019 16:56:49 +0000 (11:56 -0500)
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
gdk/gdkeventsprivate.h

index bf978e298009e937e59434bc2811194749706fb5..27c7501bd3ea35ef242524464dd29be0faab7539 100644 (file)
@@ -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;
index eefc1f4622dd97b48c560d1b387f02beeb213d5b..fe9b80a7f8ab3de10b7cad6fd2b39bcc611c6ecc 100644 (file)
@@ -418,7 +418,9 @@ struct _GdkEventDND {
   GdkDrop *drop;
 
   guint32 time;
-  gshort x_root, y_root;
+  double x_root, y_root;
+  double x;
+  double y;
 };
 
 /*