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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3112>
This commit is contained in:
Daniel van Vugt 2023-07-07 19:29:05 +08:00 committed by Marge Bot
parent 3590640932
commit 2305efa990

View File

@ -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