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
This commit is contained in:
parent
5123a1fb03
commit
46415bb248
@ -1579,24 +1579,17 @@ meta_window_actor_update_bounding_region_and_borders (MetaWindowActor *self,
|
|||||||
cairo_rectangle_int_t old_bounding_rectangle;
|
cairo_rectangle_int_t old_bounding_rectangle;
|
||||||
cairo_region_get_extents (priv->bounding_region, &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 &&
|
if (bounding_rectangle.width == old_bounding_rectangle.width &&
|
||||||
bounding_rectangle.height == old_bounding_rectangle.height)
|
bounding_rectangle.height == old_bounding_rectangle.height &&
|
||||||
{
|
priv->last_borders.invisible.left == borders.invisible.left &&
|
||||||
|
priv->last_borders.invisible.right == borders.invisible.right &&
|
||||||
if (priv->last_borders.invisible.left != borders.invisible.left &&
|
priv->last_borders.invisible.top == borders.invisible.top &&
|
||||||
priv->last_borders.invisible.right != borders.invisible.right &&
|
priv->last_borders.invisible.bottom == borders.invisible.bottom)
|
||||||
priv->last_borders.invisible.top != borders.invisible.top &&
|
return;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->last_borders = borders;
|
priv->last_borders = borders;
|
||||||
|
Loading…
Reference in New Issue
Block a user