From bce5f3f1088314e174ec7cf89b7232535d5e8a96 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 19 Aug 2014 13:48:00 -0400 Subject: [PATCH] window: Fix cursor anchoring issues when drag-unmaximizing windows The cursor was anchored wrongly when trying to unmaximize windows from dragging them from the top of the screen because of a few think-o's and some code that forgot to be updated when we moved to the frame rect coordinate system. The cursor is still offset for windows that start dragging from the top panel. This is technically correct, but looks wrong. We'll fix this in the next commit. --- src/core/window.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index dd36a9887..62dcc30f3 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -5602,19 +5602,10 @@ update_move (MetaWindow *window, ((double)(x - display->grab_initial_window_pos.x)) / ((double)display->grab_initial_window_pos.width); - display->grab_initial_window_pos.x = - x - window->saved_rect.width * prop; - display->grab_initial_window_pos.y = y; - - if (window->frame) - { - display->grab_initial_window_pos.y += window->frame->child_y / 2; - } + display->grab_initial_window_pos.x = x - window->saved_rect.width * prop; window->saved_rect.x = display->grab_initial_window_pos.x; window->saved_rect.y = display->grab_initial_window_pos.y; - display->grab_anchor_root_x = x; - display->grab_anchor_root_y = y; meta_window_unmaximize (window, META_MAXIMIZE_BOTH); return; @@ -5661,14 +5652,15 @@ update_move (MetaWindow *window, window->unconstrained_rect.y = window->saved_rect.y; meta_window_unmaximize (window, META_MAXIMIZE_BOTH); + + display->grab_initial_window_pos = work_area; + display->grab_anchor_root_x = x; + display->grab_anchor_root_y = y; + window->shaken_loose = FALSE; + + meta_window_maximize (window, META_MAXIMIZE_BOTH); } - display->grab_initial_window_pos = work_area; - display->grab_anchor_root_x = x; - display->grab_anchor_root_y = y; - window->shaken_loose = FALSE; - - meta_window_maximize (window, META_MAXIMIZE_BOTH); return; } }