gdk: Make gdk_drag_begin take doubles
authorMatthias Clasen <mclasen@redhat.com>
Sun, 17 May 2020 21:49:02 +0000 (17:49 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 17 May 2020 21:51:03 +0000 (17:51 -0400)
This is a better fit to the way we treat coordinates
everywhere else.

gdk/broadway/gdkdnd-broadway.c
gdk/broadway/gdkprivate-broadway.h
gdk/gdkdrag.h
gdk/gdksurface.c
gdk/gdksurfaceprivate.h
gdk/wayland/gdkdrag-wayland.c
gdk/wayland/gdkprivate-wayland.h
gdk/win32/gdkdrag-win32.c
gdk/win32/gdkprivate-win32.h
gdk/x11/gdkdrag-x11.c
gdk/x11/gdkprivate-x11.h

index 04db887b26aed1c0273240bb6865e39fc7a14783..7d7ccdc6371802be2176e19e547197e0cdc801fd 100644 (file)
@@ -87,8 +87,8 @@ _gdk_broadway_surface_drag_begin (GdkSurface         *surface,
                                   GdkDevice          *device,
                                   GdkContentProvider *content,
                                   GdkDragAction       actions,
-                                  gint                dx,
-                                  gint                dy)
+                                  double              dx,
+                                  double              dy)
 {
   GdkDrag *new_context;
 
index 5a4499b4085bfe6cf71fdb5925a5dd0ac57cd6a1..0a3b6d8b9d8dd8400976ddcbbffa515392363922 100644 (file)
@@ -51,8 +51,8 @@ GdkDrag * _gdk_broadway_surface_drag_begin        (GdkSurface          *surface,
                                                    GdkDevice          *device,
                                                    GdkContentProvider *content,
                                                    GdkDragAction       actions,
-                                                   gint                dx,
-                                                   gint                dy);
+                                                   double              dx,
+                                                   double              dy);
 void     _gdk_broadway_surface_translate          (GdkSurface *surface,
                                                    cairo_region_t *area,
                                                    gint       dx,
index 2c093c4eb2c921b06eec591a47291cda5a06ca4c..a3aea2ad7e2c333f4f9cfc326a26cb1d7835c74f 100644 (file)
@@ -76,8 +76,8 @@ GdkDrag *        gdk_drag_begin                (GdkSurface         *surface,
                                                 GdkDevice          *device,
                                                 GdkContentProvider *content,
                                                 GdkDragAction       actions,
-                                                gint                dx,
-                                                gint                dy);
+                                                double              dx,
+                                                double              dy);
 
 GDK_AVAILABLE_IN_ALL
 void            gdk_drag_drop_done   (GdkDrag  *drag,
index 86d6277f7e90458dac31757c7d5e78dd2734144b..7f89bedb8d75e3efb69f981142bb71f222acfa90 100644 (file)
@@ -2398,8 +2398,8 @@ gdk_drag_begin (GdkSurface          *surface,
                 GdkDevice          *device,
                 GdkContentProvider *content,
                 GdkDragAction       actions,
-                gint                dx,
-                gint                dy)
+                double              dx,
+                double              dy)
 {
   g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
   g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
index 5685d781f90e73c71ed567bc42001abcb9c86e77..e93fe4f62592d4a721bf549a8786570a3b3bff27 100644 (file)
@@ -149,12 +149,12 @@ struct _GdkSurfaceClass
   gboolean     (* beep)                 (GdkSurface       *surface);
 
   void         (* destroy_notify)       (GdkSurface *surface);
-  GdkDrag *    (* drag_begin)           (GdkSurface        *surface,
-                                         GdkDevice        *device,
-                                         GdkContentProvider*content,
-                                         GdkDragAction     actions,
-                                         gint              dx,
-                                         gint              dy);
+  GdkDrag *    (* drag_begin)           (GdkSurface         *surface,
+                                         GdkDevice          *device,
+                                         GdkContentProvider *content,
+                                         GdkDragAction       actions,
+                                         double              dx,
+                                         double              dy);
 
   gint         (* get_scale_factor)       (GdkSurface      *surface);
   void         (* get_unscaled_size)      (GdkSurface      *surface,
index 320ae27a9afee6999a5d4e3ab62f984a7f99c693..e09129f02f4172c5948a56df61f880c2e0983b06 100644 (file)
@@ -352,8 +352,8 @@ _gdk_wayland_surface_drag_begin (GdkSurface         *surface,
                                  GdkDevice          *device,
                                  GdkContentProvider *content,
                                  GdkDragAction       actions,
-                                 gint                dx,
-                                 gint                dy)
+                                 double              dx,
+                                 double              dy)
 {
   GdkWaylandDrag *drag_wayland;
   GdkDrag *drag;
index 47079bcfa6a69083f135688c54176f024aa2a0f6..a824f7bb7df53854c6be8b3e5ea705ad9e9e7958 100644 (file)
@@ -103,8 +103,8 @@ GdkDrag        *_gdk_wayland_surface_drag_begin            (GdkSurface *surface,
                                                             GdkDevice *device,
                                                             GdkContentProvider *content,
                                                             GdkDragAction actions,
-                                                            gint       dx,
-                                                            gint       dy);
+                                                            double     dx,
+                                                            double     dy);
 void            _gdk_wayland_surface_offset_next_wl_buffer (GdkSurface *surface,
                                                             int        x,
                                                             int        y);
index c8074444dc7ad6d6e756fc63ef2761fe43e77dba..b07f19d24ed258130de89b9d0ee5ac8935d85727 100644 (file)
@@ -1709,8 +1709,8 @@ _gdk_win32_surface_drag_begin (GdkSurface         *surface,
                                GdkDevice          *device,
                                GdkContentProvider *content,
                                GdkDragAction       actions,
-                               gint                dx,
-                               gint                dy)
+                               double              dx,
+                               double              dy)
 {
   GdkDrag *drag;
   GdkWin32Drag *drag_win32;
@@ -1731,8 +1731,8 @@ _gdk_win32_surface_drag_begin (GdkSurface         *surface,
   GDK_NOTE (DND, g_print ("_gdk_win32_surface_drag_begin\n"));
 
   gdk_device_get_position (device, &px, &py);
-  x_root = round (px) + dx;
-  y_root = round (py) + dy;
+  x_root = round (px + dx);
+  y_root = round (py + dy);
 
   drag_win32->start_x = x_root;
   drag_win32->start_y = y_root;
index ea86a917a3486db68b9ce933812d6910f45c4b01..e9d92d0df66c13c76b1e63bde5b8feaac2bd65ad 100644 (file)
@@ -395,8 +395,8 @@ GdkDrag *_gdk_win32_surface_drag_begin (GdkSurface         *window,
                                         GdkDevice          *device,
                                         GdkContentProvider *content,
                                         GdkDragAction       actions,
-                                        gint                x_root,
-                                        gint                y_root);
+                                        double              x_root,
+                                        double              y_root);
 
 /* Stray GdkWin32Screen members */
 gboolean _gdk_win32_get_setting (const gchar *name, GValue *value);
index c15673f7eeb3ecce3736111f06be9172b6a1703d..cbbe0414abc8b924b1a344a34f1bcadfa799b4f5 100644 (file)
@@ -1985,8 +1985,8 @@ _gdk_x11_surface_drag_begin (GdkSurface         *surface,
                              GdkDevice          *device,
                              GdkContentProvider *content,
                              GdkDragAction       actions,
-                             gint                dx,
-                             gint                dy)
+                             double              dx,
+                             double              dy)
 {
   GdkX11Drag *x11_drag;
   GdkDrag *drag;
@@ -2013,8 +2013,8 @@ _gdk_x11_surface_drag_begin (GdkSurface         *surface,
   _gdk_device_query_state (device, surface, NULL, &px, &py, NULL);
 
   gdk_x11_surface_get_root_coords (surface,
-                                   round (px) + dx,
-                                   round (py) + dy,
+                                   round (px + dx),
+                                   round (py + dy),
                                    &x_root,
                                    &y_root);
 
index 667b14a1421ee304667bc8cca5fec1a42b3c8273..7b8fbc77112847384e6c08be25a814a4f717549f 100644 (file)
@@ -223,8 +223,8 @@ GdkDrag        * _gdk_x11_surface_drag_begin (GdkSurface          *window,
                                               GdkDevice          *device,
                                               GdkContentProvider *content,
                                               GdkDragAction       actions,
-                                              gint                dx,
-                                              gint                dy);
+                                              double              dx,
+                                              double              dy);
 
 void gdk_x11_surface_get_root_coords (GdkSurface *surface,
                                       gint        x,