[mutter] MetaWindowActor: Fix incorrect short-circuit
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] MetaWindowActor: Fix incorrect short-circuit
- Date: Fri, 26 Aug 2011 17:06:57 +0000 (UTC)
commit 46415bb248aa2b2744ae1ef715ac7b0f46cc014d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Aug 11 05:32:02 2011 -0400
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 files changed, 10 insertions(+), 17 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 53aa9a2..a6f55d2 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]