diff options
author | Daniel van Vugt <daniel.van.vugt@canonical.com> | 2020-10-20 17:49:26 +0800 |
---|---|---|
committer | verdre <jonas@dressler.it> | 2020-10-23 22:54:25 +0000 |
commit | a24b2f4b0fc72ebe262988a14a6fcd58d531e2bb (patch) | |
tree | f2cc2985b449c10bd5186c602a2cf893d0f6bdfa | |
parent | cc7c7fa015444b40450096615c5455746bd1325f (diff) | |
download | mutter-a24b2f4b0fc72ebe262988a14a6fcd58d531e2bb.tar.gz |
background-content: Assume background clones are always transformed
Because clones may not have identical geometry to their source actors.
So we can't use the geometry of the source actor to decide to take the
more optimized (more clipped) path.
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1480
-rw-r--r-- | src/compositor/meta-background-content.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/compositor/meta-background-content.c b/src/compositor/meta-background-content.c index ce6ee2fff..7990ad47b 100644 --- a/src/compositor/meta-background-content.c +++ b/src/compositor/meta-background-content.c @@ -511,29 +511,36 @@ meta_background_content_paint_content (ClutterContent *content, if ((self->clip_region && cairo_region_is_empty (self->clip_region))) return; - clutter_actor_get_transformed_position (actor, - &transformed_x, - &transformed_y); - rect_within_stage.x = floorf (transformed_x); - rect_within_stage.y = floorf (transformed_y); - - clutter_actor_get_transformed_size (actor, - &transformed_width, - &transformed_height); - rect_within_stage.width = roundf (transformed_width); - rect_within_stage.height = roundf (transformed_height); - clutter_actor_get_content_box (actor, &actor_box); rect_within_actor.x = actor_box.x1; rect_within_actor.y = actor_box.y1; rect_within_actor.width = actor_box.x2 - actor_box.x1; rect_within_actor.height = actor_box.y2 - actor_box.y1; - untransformed = - rect_within_actor.x == rect_within_stage.x && - rect_within_actor.y == rect_within_stage.y && - rect_within_actor.width == rect_within_stage.width && - rect_within_actor.height == rect_within_stage.height; + if (clutter_actor_is_in_clone_paint (actor)) + { + untransformed = FALSE; + } + else + { + clutter_actor_get_transformed_position (actor, + &transformed_x, + &transformed_y); + rect_within_stage.x = floorf (transformed_x); + rect_within_stage.y = floorf (transformed_y); + + clutter_actor_get_transformed_size (actor, + &transformed_width, + &transformed_height); + rect_within_stage.width = roundf (transformed_width); + rect_within_stage.height = roundf (transformed_height); + + untransformed = + rect_within_actor.x == rect_within_stage.x && + rect_within_actor.y == rect_within_stage.y && + rect_within_actor.width == rect_within_stage.width && + rect_within_actor.height == rect_within_stage.height; + } if (untransformed) /* actor and stage space are the same */ { |