From b32c837df9d0ec698b7ea1d92d2e62bd2aa58dea Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 29 May 2014 14:07:58 -0400 Subject: [PATCH] window: Fix placement not actually placing windows Since we often call meta_window_move_resize_now immediately after mapping a window, we need to make sure that the placed coordinates are saved in the unconstrained_rect. Ideally, placement positions wouldn't be part of the constraints system, but instead are just done inside meta_window_move_resize_internal as part of a special path. We're still working out the kinks of one large-scale refactor, so it's best not to do another one while the first is going on. This would be a great future cleanup, though: untangling constraints and placement, alongside the force_placement state machine and friends. --- src/core/window.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/window.c b/src/core/window.c index e2a0777ad..7ae3dada9 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3715,6 +3715,16 @@ meta_window_move_resize_internal (MetaWindow *window, &constrained_rect); } + /* If we did placement, then we need to save the position that the window + * was placed at to make sure that meta_window_move_resize_now places the + * window correctly. + */ + if (did_placement) + { + window->unconstrained_rect.x = constrained_rect.x; + window->unconstrained_rect.y = constrained_rect.y; + } + /* Do the protocol-specific move/resize logic */ META_WINDOW_GET_CLASS (window)->move_resize_internal (window, gravity, unconstrained_rect, constrained_rect, flags, &result);