diff options
author | Luca Bacci <luca.bacci982@gmail.com> | 2021-10-29 18:39:52 +0200 |
---|---|---|
committer | Luca Bacci <luca.bacci982@gmail.com> | 2021-11-07 19:08:30 +0100 |
commit | 4c8e7038039914b2f6dea94071c3c029ed39d1c0 (patch) | |
tree | eecbe5047b4bda6c09203efe3dd4881dcc06302e /gdk/win32/gdkevents-win32.c | |
parent | 8338e55549bd7042a9f2cb78479c24d4804e615d (diff) | |
download | gtk+-4c8e7038039914b2f6dea94071c3c029ed39d1c0.tar.gz |
GdkWin32: Remove the global screen offset
Removes the _gdk_offset_x / _gdk_offset_y variables,
as today are not needed anymore.
Diffstat (limited to 'gdk/win32/gdkevents-win32.c')
-rw-r--r-- | gdk/win32/gdkevents-win32.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 2576a6711d..6327cca1c2 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -1291,13 +1291,12 @@ make_crossing_event (GdkDevice *physical_device, } /* Acquires actual client area size of the underlying native window. - * Rectangle is in GDK screen coordinates (_gdk_offset_* is added). * Returns FALSE if configure events should be inhibited, * TRUE otherwise. */ gboolean _gdk_win32_get_window_rect (GdkSurface *window, - RECT *rect) + RECT *rect) { RECT client_rect; POINT point; @@ -1312,11 +1311,7 @@ _gdk_win32_get_window_rect (GdkSurface *window, /* top level windows need screen coords */ if (GDK_IS_TOPLEVEL (window)) - { - ClientToScreen (hwnd, &point); - point.x += _gdk_offset_x * impl->surface_scale; - point.y += _gdk_offset_y * impl->surface_scale; - } + ClientToScreen (hwnd, &point); rect->left = point.x; rect->top = point.y; @@ -2410,15 +2405,15 @@ gdk_event_translate (MSG *msg, impl = GDK_WIN32_SURFACE (window); /* If we haven't moved, don't create any GDK event. Windows - * sends WM_MOUSEMOVE messages after a new window is shows under + * 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 + _gdk_offset_x) / impl->surface_scale == current_root_x && - (msg->pt.y + _gdk_offset_y) / impl->surface_scale == current_root_y) - break; + if (msg->pt.x / impl->surface_scale == current_root_x && + msg->pt.y / impl->surface_scale == current_root_y) + break; - current_root_x = (msg->pt.x + _gdk_offset_x) / impl->surface_scale; - current_root_y = (msg->pt.y + _gdk_offset_y) / impl->surface_scale; + current_root_x = msg->pt.x / impl->surface_scale; + current_root_y = msg->pt.y / impl->surface_scale; 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); |