From: Luca Bacci Date: Wed, 21 Jun 2023 13:57:40 +0000 (+0200) Subject: GdkWin32: Unscaled coordinates in current_root_x, current_root_y X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~81^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5e9daa9728efed8cf9c434667e13e995a629a3f7;p=gtk4.git 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 --- 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;