From 80eeac71f98ec387b141cbaa540d67619bc954b4 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 30 Nov 2012 20:21:23 -0500 Subject: [PATCH] text: Prevent a relayout if font descriptions or attrs are equal https://bugzilla.gnome.org/show_bug.cgi?id=689399 --- clutter/clutter-text.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index 3cefa83fb..4f27d72b3 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -571,7 +571,8 @@ clutter_text_set_font_description_internal (ClutterText *self, { ClutterTextPrivate *priv = self->priv; - if (priv->font_desc == desc) + if (priv->font_desc == desc || + pango_font_description_equal (priv->font_desc, desc)) return; if (priv->font_desc != NULL) @@ -5423,6 +5424,12 @@ clutter_text_set_attributes (ClutterText *self, priv = self->priv; + /* While we should probably test for equality, Pango doesn't + * provide us an easy method to check for AttrList equality. + */ + if (priv->attrs == attrs) + return; + if (attrs) pango_attr_list_ref (attrs);