From 4acb9024234a7e564222c5c4280c8cb2695e3a76 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 21 May 2014 09:08:39 -0400 Subject: [PATCH] window: Correct the anchoring of drag moving / resizing Now that meta_window_move_resize and friends act in frame rect coordinates, we need to convert the initial grab_anchor_window_pos storage to be in frame rect coordinates as well. --- src/core/display.c | 2 +- src/core/window.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index 74322506f..b195cf20f 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1828,7 +1828,7 @@ meta_display_begin_grab_op (MetaDisplay *display, meta_window_get_client_root_coords (display->grab_window, &display->grab_initial_window_pos); - display->grab_anchor_window_pos = display->grab_initial_window_pos; + meta_window_get_frame_rect (display->grab_window, &display->grab_anchor_window_pos); if (meta_is_wayland_compositor ()) meta_display_sync_wayland_input_focus (display); diff --git a/src/core/window.c b/src/core/window.c index 3384cc7a1..b29179819 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3139,6 +3139,9 @@ meta_window_unmaximize_internal (MetaWindow *window, window->display->grab_window == window) { window->display->grab_anchor_window_pos = window->unconstrained_rect; + meta_window_client_rect_to_frame_rect (window, + &window->display->grab_anchor_window_pos, + &window->display->grab_anchor_window_pos); } meta_window_recalc_features (window); @@ -6553,8 +6556,8 @@ warp_grab_pointer (MetaWindow *window, display->grab_anchor_root_y = *y; display->grab_latest_motion_x = *x; display->grab_latest_motion_y = *y; - meta_window_get_client_root_coords (window, - &display->grab_anchor_window_pos); + meta_window_get_frame_rect (window, + &display->grab_anchor_window_pos); { MetaBackend *backend = meta_get_backend ();