[mutter] window: Allow passing garbage window sizes for move-only actions
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] window: Allow passing garbage window sizes for move-only actions
- Date: Thu, 22 May 2014 19:39:29 +0000 (UTC)
commit 9df5b179402e1b1733de3f19cfa2c472c0e06043
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed May 21 08:41:32 2014 -0400
window: Allow passing garbage window sizes for move-only actions
We'll just fix them up in meta_window_move_resize_internal.
src/core/window.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 3acc7d7..449277b 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -3686,6 +3686,14 @@ meta_window_move_resize_internal (MetaWindow *window,
requested_rect = client_rect;
}
+ /* If this is only a move, then ignore the passed in size and
+ * just use the existing size of the window. */
+ if ((flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION)) == META_IS_MOVE_ACTION)
+ {
+ requested_rect.width = window->rect.width;
+ requested_rect.height = window->rect.height;
+ }
+
new_rect = requested_rect;
/* Save the unconstrained rectangle to the position we should be at
@@ -3764,17 +3772,11 @@ meta_window_move (MetaWindow *window,
int root_y_nw)
{
MetaMoveResizeFlags flags;
- MetaRectangle rect;
+ MetaRectangle rect = { root_x_nw, root_y_nw, 0, 0 };
g_return_if_fail (!window->override_redirect);
flags = (user_op ? META_IS_USER_ACTION : 0) | META_IS_MOVE_ACTION;
-
- rect.x = root_x_nw;
- rect.y = root_y_nw;
- rect.width = window->rect.width;
- rect.height = window->rect.height;
-
meta_window_move_resize_internal (window, flags, NorthWestGravity, rect);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]