[mutter] window: Use the target rect for the grab anchor position on unmaximize
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] window: Use the target rect for the grab anchor position on unmaximize
- Date: Wed, 23 Nov 2016 17:58:05 +0000 (UTC)
commit 1956a6ae76ae487fab25eec35ea30b9e483fe528
Author: Rui Matos <tiagomatos gmail com>
Date: Mon Sep 26 17:09:52 2016 +0200
window: Use the target rect for the grab anchor position on unmaximize
A window's unconstrained_rect is essentially just the target rectangle
we hand to meta_window_move_resize_internal() except it's not updated
until the window actually moves or resizes.
As such, for wayland client resizes, since they're async, using
window->unconstrained_rect right after calling move_resize_internal()
to update the grab anchor position on unmaximize doesn't work as it
does for X clients.
To fix this, we can just use the target rectangle for the grab
anchor. Note that comment here was already wrong since it says we
should be taking constraints into account and yet the code used the
unconstrained rect anyway.
https://bugzilla.gnome.org/show_bug.cgi?id=770345
src/core/window.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 6cef635..21557f3 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -3106,14 +3106,12 @@ meta_window_unmaximize (MetaWindow *window,
/* When we unmaximize, if we're doing a mouse move also we could
* get the window suddenly jumping to the upper left corner of
* the workspace, since that's where it was when the grab op
- * started. So we need to update the grab state. We have to do
- * it after the actual operation, as the window may have been moved
- * by constraints.
+ * started. So we need to update the grab anchor position.
*/
if (meta_grab_op_is_moving (window->display->grab_op) &&
window->display->grab_window == window)
{
- window->display->grab_anchor_window_pos = window->unconstrained_rect;
+ window->display->grab_anchor_window_pos = target_rect;
}
meta_window_recalc_features (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]