From 2305efa990a43ec5a46c1fbb14a2d6b4613d8089 Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Fri, 7 Jul 2023 19:29:05 +0800 Subject: [PATCH] clutter/paint-volume: Don't over-enlarge 2D actorless paint volumes A 2D actorless paint volume can't ever need `enlarge_for_effects` because it has no depth. Clamping to the pixel boundary is sufficient in this case and avoids extending volumes on the edge of the view into the next view. Which then avoids unnecessary secondary monitor updates. Paint volumes correctly become actorless where `clutter_actor_finish_layout` calls `_clutter_paint_volume_transform_relative`. Relates to: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6819 Part-of: --- clutter/clutter/clutter-paint-volume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/clutter-paint-volume.c b/clutter/clutter/clutter-paint-volume.c index e6d16da69..022ba0951 100644 --- a/clutter/clutter/clutter-paint-volume.c +++ b/clutter/clutter/clutter-paint-volume.c @@ -1061,8 +1061,8 @@ _clutter_paint_volume_get_stage_paint_box (const ClutterPaintVolume *pv, _clutter_paint_volume_get_bounding_box (&projected_pv, box); - if (pv->is_2d && pv->actor && - clutter_actor_get_z_position (pv->actor) == 0) + if (pv->is_2d && + (!pv->actor || clutter_actor_get_z_position (pv->actor) == 0)) { /* If the volume/actor are perfectly 2D, take the bounding box as * good. We won't need to add any extra room for sub-pixel positioning