[mutter] window: Fix cursor anchoring issues when drag-unmaximizing windows
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] window: Fix cursor anchoring issues when drag-unmaximizing windows
- Date: Tue, 19 Aug 2014 18:01:24 +0000 (UTC)
commit bce5f3f1088314e174ec7cf89b7232535d5e8a96
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Aug 19 13:48:00 2014 -0400
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 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index dd36a98..62dcc30 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;
+ 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);
+ }
- meta_window_maximize (window, META_MAXIMIZE_BOTH);
return;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]