From 5e9daa9728efed8cf9c434667e13e995a629a3f7 Mon Sep 17 00:00:00 2001 From: Luca Bacci Date: Wed, 21 Jun 2023 15:57:40 +0200 Subject: [PATCH] GdkWin32: Unscaled coordinates in current_root_x, current_root_y Also modify gdk_win32_surface_do_move_resize_drag() to take unscaled root coordinates. Fixes #5877 --- gdk/win32/gdkevents-win32.c | 8 ++++---- gdk/win32/gdksurface-win32.c | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 4f8feed052..326e511070 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -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); diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c index ecae5e7d6d..72b65407a2 100644 --- a/gdk/win32/gdksurface-win32.c +++ b/gdk/win32/gdksurface-win32.c @@ -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; -- 2.30.2