Skip to content

Conversation

@Sunderland93
Copy link
Contributor

@Sunderland93 Sunderland93 commented Feb 8, 2026

See individual commit messages

This is the preparation for https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285 which is needed to drive each output on it's own refresh rate.

It's also improves performance and quality on HiDPI displays.

Cinnamon part: linuxmint/cinnamon#13542
Cinnamon-Spices-Applets: linuxmint/cinnamon-spices-applets#8293

This commit removes the DELEGATE_LAYOUT and the ABSOLUTE_ORIGIN_CHANGED allocation flags from Clutter,
replacing the latter one with an internal boolean that's more
useful and won't get in the way of optimizations and bugfixes.
Since that leaves no more allocation flags, those are removed entirely,
which also leaves no reason to keep the "allocation-changed" signal, so remove that, too.
Fix some issues with allocations and add an optimization to bail out of allocation cycles
if only the absolute origin changed (we can do this because now we no longer need to notify
all actors about the absolute origin change using the allocation flag).
For ClutterClones we need to apply a scale to the texture of the clone
to ensure the painted texture of the source actor actually fits the
allocation of the clone. We're doing this using the transformation
matrix instead of using the scale_x/scale_y properties of ClutterActor
to allow users to scale ClutterClones using that API independently.
Now it's quite a bad idea to get the allocation boxes for calculating
that scale using clutter_actor_get_allocation_box(), since that method
will internally do an immediate relayout of the stage in case the actor
isn't allocated. Another side effect of that approach is that it makes
it impossible to invalidate the transform (which is needed for the next
commit when we start caching those matrices) properly.
So since we eventually allocate both the source actor and the clone
ourselves anyway, we can simply use the allocation box inside
clutter_clone_allocate() (which is definitely updated and valid at that
point) to calculate the scale factor.
Add a clutter_actor_peek_stage_views() method and a stage-views-changed signal to ClutterActor.
This doesn't invalidate the stage-views list on changes to the transformation of the actors yet,
for that we need another new ClutterActor method to invalidate the custom transformations applied
via the apply_transform() vfunc. Also things will get quite a bit more expensive when doing that
(the transformation matrix will have to be put together more often),
so we probably also want the caching of transformation matrices in place when we start doing that.
This commit changes the resource scale API to be based on ClutterActors new stage-views list.
It also introduces proper support for actors like ClutterText where the allocation
depends on the resource-scale, which allows getting the size and position perfect on the first frame.
@Sunderland93 Sunderland93 marked this pull request as draft February 8, 2026 15:49
@mtwebster
Copy link
Member

I remember when I did my big mutter/muffin refactor around 5.4 I stopped at the version I stopped at (3.36.* I think?) because I would have had to break a lot of third-party spices. I think because of allocate/paint arguments.

I don't want to avoid doing what we need to here - I stopped short before because there were already many changes and I needed a cutoff point. But just beware of the impact these changes may have in cinnamon-spices-* repos also. In the past I made a list of impacted spices so I could raise awareness when I had to mass-break something.

@anaximeno
Copy link

I'm available to help with migrations on spices if needed.

@Sunderland93
Copy link
Contributor Author

@anaximeno this would be pretty cool, since I have a very poor knowledge of JS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants