From 46415bb248aa2b2744ae1ef715ac7b0f46cc014d Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 11 Aug 2011 05:32:02 -0400 Subject: [PATCH] MetaWindowActor: Fix incorrect short-circuit The code here was wrong in every way: it only updated the shape if all the borders changed. It never saved new last_borders even if it *had* changed, and the bounding rectangle's x and y positions were still important otherwise. This had user-visible impact when doing simple things like changing the border_width. It would short-circuit here and due to the above incorrectness, weirdness could happen where windows would be cut off and so on. https://bugzilla.gnome.org/show_bug.cgi?id=656334 --- src/compositor/meta-window-actor.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index 53aa9a2d3..a6f55d25f 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -1579,24 +1579,17 @@ meta_window_actor_update_bounding_region_and_borders (MetaWindowActor *self, cairo_rectangle_int_t old_bounding_rectangle; cairo_region_get_extents (priv->bounding_region, &old_bounding_rectangle); + /* Because the bounding region doesn't include the invisible borders, + * we need to make sure that the border sizes haven't changed before + * short-circuiting early. + */ if (bounding_rectangle.width == old_bounding_rectangle.width && - bounding_rectangle.height == old_bounding_rectangle.height) - { - - if (priv->last_borders.invisible.left != borders.invisible.left && - priv->last_borders.invisible.right != borders.invisible.right && - priv->last_borders.invisible.top != borders.invisible.top && - priv->last_borders.invisible.bottom != borders.invisible.bottom) - { - /* Because the bounding region doesn't include the invisible borders, - * we need to make sure that the border sizes haven't changed before - * short-circuiting early. If they have, update the mask texture here. - */ - meta_window_actor_update_shape (self); - } - - return; - } + bounding_rectangle.height == old_bounding_rectangle.height && + priv->last_borders.invisible.left == borders.invisible.left && + priv->last_borders.invisible.right == borders.invisible.right && + priv->last_borders.invisible.top == borders.invisible.top && + priv->last_borders.invisible.bottom == borders.invisible.bottom) + return; } priv->last_borders = borders;