diff options
author | Alexander Larsson <alexl@redhat.com> | 2012-12-04 16:53:06 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2012-12-04 16:59:08 +0100 |
commit | 21ff39ba8a685e2c87f26f7271877d1eeadcb3ed (patch) | |
tree | c5ea11af8c6be1b5b0c93a4b68daf710c8e3f0e0 | |
parent | 0cf03dd13b7a636131c4d5f7c6b4d7e51e73175b (diff) | |
download | gtk+-wip/css-optimize2.tar.gz |
Don't queue resize for hidden widgets without a size groupwip/css-optimize2
queue_resize basically tells the parent widget that it may need
to pick a different size/layout. However, for a hidden child widget
that should never be needed. It may be that the widget is in a
sizegroup that has ignore_hidden == FALSE though, so it may
affect the size group calculations.
However, if a widget is not visible and not in a size group then
its safe to avoid the resize, as the widget will be resized on
becoming visible anyway.
This avoids a lot of size allocation for hidden things like menus
and tooltips.
-rw-r--r-- | gtk/gtkwidget.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 9141a707f7..1350af5ec6 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -4654,7 +4654,9 @@ gtk_widget_queue_resize (GtkWidget *widget) if (gtk_widget_get_realized (widget)) gtk_widget_queue_draw (widget); - _gtk_size_group_queue_resize (widget, 0); + if (gtk_widget_get_visible (widget) || + widget->priv->have_size_groups) + _gtk_size_group_queue_resize (widget, 0); } /** |