From c2abe43ee7ab77a7160f4872753f5df2a5138c17 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 7 Jul 2014 14:08:07 -0400 Subject: [PATCH] window: Only update the unconstrained rect when we actually moved/resized Since Wayland configures are more of a hint to the client than anything, we don't want to save the unconstrained rect when we're just hinting to the client that it should resize, since it could ignore us. This would get us stuck in a loop, since meta_window_move_resize_now would use the unconstrained_rect to resize, and we don't remove the resize from the queue if we have an outstanding request like that. This fixes a bunch of traffic / CPU usage when trying to resize weston-terminal. --- src/core/window.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index 3ecfdcd70..36aa9e4be 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3690,10 +3690,6 @@ meta_window_move_resize_internal (MetaWindow *window, unconstrained_rect.height = window->rect.height; } - /* Save the unconstrained rectangle to the position we should be at - * before constraints kick in. */ - window->unconstrained_rect = unconstrained_rect; - constrained_rect = unconstrained_rect; if (flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION)) { @@ -3713,8 +3709,8 @@ meta_window_move_resize_internal (MetaWindow *window, */ if (did_placement) { - window->unconstrained_rect.x = constrained_rect.x; - window->unconstrained_rect.y = constrained_rect.y; + unconstrained_rect.x = constrained_rect.x; + unconstrained_rect.y = constrained_rect.y; } /* Do the protocol-specific move/resize logic */ @@ -3728,6 +3724,8 @@ meta_window_move_resize_internal (MetaWindow *window, if ((result & (META_MOVE_RESIZE_RESULT_MOVED | META_MOVE_RESIZE_RESULT_RESIZED)) != 0 || did_placement) { + window->unconstrained_rect = unconstrained_rect; + if (window->known_to_compositor) meta_compositor_sync_window_geometry (window->display->compositor, window,