GdkWin32: Unscaled coordinates in current_root_x, current_root_y
authorLuca Bacci <luca.bacci982@gmail.com>
Wed, 21 Jun 2023 13:57:40 +0000 (15:57 +0200)
committerLuca Bacci <luca.bacci982@gmail.com>
Wed, 21 Jun 2023 14:01:42 +0000 (16:01 +0200)
Also modify gdk_win32_surface_do_move_resize_drag() to take
unscaled root coordinates.

Fixes #5877

gdk/win32/gdkevents-win32.c
gdk/win32/gdksurface-win32.c

index 4f8feed052cd74f469ef210cb8f95954c504c1ce..326e511070fe2be3f6e9ceae249bcdc761fc9995 100644 (file)
@@ -2350,12 +2350,12 @@ gdk_event_translate (MSG *msg,
        * sends WM_MOUSEMOVE messages after a new window is shown under
        * the mouse, even if the mouse hasn't moved. This disturbs gtk.
        */
-      if (msg->pt.x / impl->surface_scale == current_root_x &&
-          msg->pt.y / impl->surface_scale == current_root_y)
+      if (msg->pt.x == current_root_x &&
+          msg->pt.y == current_root_y)
         break;
 
-      current_root_x = msg->pt.x / impl->surface_scale;
-      current_root_y = msg->pt.y / impl->surface_scale;
+      current_root_x = msg->pt.x;
+      current_root_y = msg->pt.y;
 
       if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
         gdk_win32_surface_do_move_resize_drag (window, current_root_x, current_root_y);
index ecae5e7d6dc865baf720ece0fce9b3852c6b757a..72b65407a2f6e3a814eec2791dd67154de9c5fd3 100644 (file)
@@ -3652,6 +3652,9 @@ gdk_win32_surface_do_move_resize_drag (GdkSurface *window,
   if (!_gdk_win32_get_window_rect (window, &rect))
     return;
 
+  x /= impl->surface_scale;
+  y /= impl->surface_scale;
+
   if (context->current_root_x == x &&
       context->current_root_y == y)
     return;