[gtk+] wayland: print correct coordinates during DnD



commit 09273d91f3a8b2e8bcbbaf5f8f81e91ff7ca1ea6
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Mon Jul 6 11:21:41 2015 -0500

    wayland: print correct coordinates during DnD
    
    Convert wl_fixed values to floats for printing, rather than printing
    them as non-meaningful integers.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752025

 gdk/wayland/gdkdevice-wayland.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index d16c92f..7fb27c1 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -710,8 +710,8 @@ data_device_enter (void                  *data,
     return;
 
   GDK_NOTE (EVENTS,
-            g_message ("data device enter, data device %p serial %u, surface %p, x %d y %d, offer %p",
-                       data_device, serial, surface, x, y, offer));
+            g_message ("data device enter, data device %p serial %u, surface %p, x %f y %f, offer %p",
+                       data_device, serial, surface, wl_fixed_to_double (x), wl_fixed_to_double (y), offer));
 
   /* Update pointer state, so device state queries work during DnD */
   device->pointer_focus = g_object_ref (dest_window);
@@ -769,8 +769,8 @@ data_device_motion (void                  *data,
 {
   GdkWaylandDeviceData *device = (GdkWaylandDeviceData *) data;
 
-  g_debug (G_STRLOC ": %s data_device = %p, time = %d, x = %d, y = %d",
-           G_STRFUNC, data_device, time, x, y);
+  g_debug (G_STRLOC ": %s data_device = %p, time = %d, x = %f, y = %f",
+           G_STRFUNC, data_device, time, wl_fixed_to_double (x), wl_fixed_to_double (y));
 
   if (!gdk_drag_context_get_dest_window (device->drop_context))
     return;
@@ -976,8 +976,9 @@ pointer_handle_motion (void              *data,
                    &event->motion.y_root);
 
   GDK_NOTE (EVENTS,
-            g_message ("motion %d %d, device %p state %d",
-                       sx, sy, device, event->button.state));
+            g_message ("motion %f %f, device %p state %d",
+                       wl_fixed_to_double (sx), wl_fixed_to_double (sy),
+                      device, event->button.state));
 
   _gdk_wayland_display_deliver_event (device->display, event);
 }


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