summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2019-04-01 14:18:30 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2019-04-01 14:22:38 +0800
commit896104939b6ec673ecb9113886b5fb9d0ef377ac (patch)
tree9224827f1a14eae225d9554e4e4c238591cb0679 /gdk
parent19f4fce931cf578a2d25743c2c890734450213df (diff)
downloadgtk+-896104939b6ec673ecb9113886b5fb9d0ef377ac.tar.gz
gdksurface-win32.c: Acquire root coordinates on drag/move
As in commit d45996c, the x and y coordinates passed into begin_drag and begin_move are no longer root coordinates but are now surface coordinates. Use the x and y surface coordinates to acquire the root x and y coordinates so that resizing and moving can work as expected.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/win32/gdksurface-win32.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index e5a945c9bf..7c71706ed4 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -3865,8 +3865,8 @@ setup_drag_move_resize_context (GdkSurface *window,
GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
- gint root_x,
- gint root_y,
+ gint x,
+ gint y,
guint32 timestamp)
{
RECT rect;
@@ -3874,6 +3874,9 @@ setup_drag_move_resize_context (GdkSurface *window,
GdkSurface *pointer_window;
GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
+ gint root_x, root_y;
+
+ gdk_win32_surface_get_root_coords (window, x, y, &root_x, &root_y);
/* Before we drag, we need to undo any maximization or snapping.
* AeroSnap behaviour:
@@ -4507,8 +4510,8 @@ gdk_win32_surface_begin_resize_drag (GdkSurface *window,
GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
- gint root_x,
- gint root_y,
+ gint x,
+ gint y,
guint32 timestamp)
{
GdkSurfaceImplWin32 *impl;
@@ -4536,15 +4539,15 @@ gdk_win32_surface_begin_resize_drag (GdkSurface *window,
setup_drag_move_resize_context (window, &impl->drag_move_resize_context,
GDK_WIN32_DRAGOP_RESIZE, edge, device,
- button, root_x, root_y, timestamp);
+ button, x, y, timestamp);
}
static void
gdk_win32_surface_begin_move_drag (GdkSurface *window,
GdkDevice *device,
gint button,
- gint root_x,
- gint root_y,
+ gint x,
+ gint y,
guint32 timestamp)
{
GdkSurfaceImplWin32 *impl;
@@ -4571,7 +4574,7 @@ gdk_win32_surface_begin_move_drag (GdkSurface *window,
setup_drag_move_resize_context (window, &impl->drag_move_resize_context,
GDK_WIN32_DRAGOP_MOVE, GDK_SURFACE_EDGE_NORTH_WEST,
- device, button, root_x, root_y, timestamp);
+ device, button, x, y, timestamp);
}