summaryrefslogtreecommitdiff
path: root/clutter
diff options
context:
space:
mode:
authorJonas Dreßler <verdre@v0yd.nl>2021-03-01 10:14:37 +0100
committerMarge Bot <marge-bot@gnome.org>2021-03-02 15:01:03 +0000
commitc6935ad5b7dc585696f155f1785dccfbd06d3040 (patch)
treed9c2647d81b5e461d9c186d30a538f22184a6a25 /clutter
parent54b974b129f837886cc91bbb1fa8f49237cc10c0 (diff)
downloadmutter-c6935ad5b7dc585696f155f1785dccfbd06d3040.tar.gz
clutter/text: Avoid relayout on PangoAttributes changes when possible
ClutterText allows setting a custom PangoAttrList, and St uses that to set the text style it's reading from CSS. One style St enforces using this mechanism is the text color and setting the text color should obviously not affect the size of the layout. ClutterText does queue a relayout in that case though because it unconditionally queues a relayout when updating the PangoAttrList. We can avoid this relayout by reusing an optimization ClutterText has: clutter_text_queue_redraw_or_relayout() will only queue a relayout if the requested size of the layout changed. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1750>
Diffstat (limited to 'clutter')
-rw-r--r--clutter/clutter/clutter-text.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/clutter/clutter/clutter-text.c b/clutter/clutter/clutter-text.c
index 159fa330e..5ecc1807a 100644
--- a/clutter/clutter/clutter-text.c
+++ b/clutter/clutter/clutter-text.c
@@ -6020,11 +6020,9 @@ clutter_text_set_attributes (ClutterText *self,
priv->effective_attrs = NULL;
}
- clutter_text_dirty_cache (self);
+ clutter_text_queue_redraw_or_relayout (self);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_ATTRIBUTES]);
-
- clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
}
/**