Skip to content
Browse files

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
  • Loading branch information...
1 parent 5123a1f commit 46415bb248aa2b2744ae1ef715ac7b0f46cc014d @magcius magcius committed Aug 11, 2011
Showing with 10 additions and 17 deletions.
  1. +10 −17 src/compositor/meta-window-actor.c
View
27 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;

0 comments on commit 46415bb

Please sign in to comment.
Something went wrong with that request. Please try again.