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.
This commit is contained in:
Jasper St. Pierre 2014-07-07 14:08:07 -04:00
parent 1de2fd7122
commit c2abe43ee7

View File

@ -3690,10 +3690,6 @@ meta_window_move_resize_internal (MetaWindow *window,
unconstrained_rect.height = window->rect.height; 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; constrained_rect = unconstrained_rect;
if (flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION)) if (flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION))
{ {
@ -3713,8 +3709,8 @@ meta_window_move_resize_internal (MetaWindow *window,
*/ */
if (did_placement) if (did_placement)
{ {
window->unconstrained_rect.x = constrained_rect.x; unconstrained_rect.x = constrained_rect.x;
window->unconstrained_rect.y = constrained_rect.y; unconstrained_rect.y = constrained_rect.y;
} }
/* Do the protocol-specific move/resize logic */ /* 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) 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) if (window->known_to_compositor)
meta_compositor_sync_window_geometry (window->display->compositor, meta_compositor_sync_window_geometry (window->display->compositor,
window, window,