diff options
author | Benjamin Otte <otte@redhat.com> | 2015-09-28 05:48:57 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-10-28 19:44:28 +0100 |
commit | a31123e9f0a12b3eeeaf65f8ea87d1a177aa454a (patch) | |
tree | e3ea334eac20349805c91b226047fa09cafe60f6 /gtk/gtksizegroup.c | |
parent | a4587ef4a0988bd6817895fa7920801163091ca6 (diff) | |
download | gtk+-a31123e9f0a12b3eeeaf65f8ea87d1a177aa454a.tar.gz |
sizegroup: Skip resizes on widgets that have resize queued
Widgets that already have a resize queued don't need to walk the whole
parent chain and queue another resize. It's enough to do it once per
resize.
This also means that sizegroups cannot use the shortcut of just
invalidating the first widget in the group anymore. That widget might
already have a resize queued while others don't.
Diffstat (limited to 'gtk/gtksizegroup.c')
-rw-r--r-- | gtk/gtksizegroup.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c index 3eddc1fddb..a6e0d1f600 100644 --- a/gtk/gtksizegroup.c +++ b/gtk/gtksizegroup.c @@ -217,6 +217,9 @@ queue_resize_on_widget (GtkWidget *widget, do { + if (gtk_widget_get_resize_needed (parent)) + return; + gtk_widget_queue_resize_on_widget (parent); if (!check_siblings || _gtk_widget_get_sizegroups (parent) == NULL) @@ -268,9 +271,12 @@ static void queue_resize_on_group (GtkSizeGroup *size_group) { GtkSizeGroupPrivate *priv = size_group->priv; + GSList *list; - if (priv->widgets) - queue_resize_on_widget (priv->widgets->data, TRUE); + for (list = priv->widgets; list; list = list->next) + { + gtk_widget_queue_resize (list->data); + } } static void |