[mutter] window: Fix placement not actually placing windows
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] window: Fix placement not actually placing windows
- Date: Thu, 29 May 2014 18:10:20 +0000 (UTC)
commit b32c837df9d0ec698b7ea1d92d2e62bd2aa58dea
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu May 29 14:07:58 2014 -0400
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 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index e2a0777..7ae3dad 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]