diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-05-29 14:07:58 -0400 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-05-29 14:09:57 -0400 |
commit | b32c837df9d0ec698b7ea1d92d2e62bd2aa58dea (patch) | |
tree | d4b2a98793f7e0714595188fb07e51e2b2d5bdab | |
parent | dd03a76d5155620bd0ee1f890bd95d46bf78ade2 (diff) | |
download | mutter-b32c837df9d0ec698b7ea1d92d2e62bd2aa58dea.tar.gz |
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.
-rw-r--r-- | src/core/window.c | 10 |
1 files changed, 10 insertions, 0 deletions
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); |