diff options
author | Benjamin Otte <otte@redhat.com> | 2015-10-08 13:41:50 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-10-09 15:32:11 +0200 |
commit | 562bfc901df2cc9f517014ad7dc2dd0bdc5c1869 (patch) | |
tree | e1aa08f85e58d63bfda53fea408846683590bf15 /gtk/gtkcontainer.c | |
parent | 0b92fab92154fe4151e26cb8450a0adce7d1cddc (diff) | |
download | gtk+-wip/otte/queue-resize.tar.gz |
container: Don't keep our own variable trying to track need for resizewip/otte/queue-resize
Insteaad, introduce gtk_widget_needs_allocate() and use that.
Diffstat (limited to 'gtk/gtkcontainer.c')
-rw-r--r-- | gtk/gtkcontainer.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index 4eff5b54d0..e6a58b2dee 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -264,7 +264,6 @@ struct _GtkContainerPrivate guint has_focus_chain : 1; guint reallocate_redraws : 1; - guint resize_pending : 1; guint restyle_pending : 1; guint resize_mode : 2; guint request_mode : 2; @@ -2008,13 +2007,12 @@ gtk_container_idle_sizer (GdkFrameClock *clock, * than trying to explicitly work around them with some extra flags, * since it doesn't cause any actual harm. */ - if (container->priv->resize_pending) + if (gtk_widget_needs_allocate (GTK_WIDGET (container))) { - container->priv->resize_pending = FALSE; gtk_container_check_resize (container); } - if (!container->priv->restyle_pending && !container->priv->resize_pending) + if (!container->priv->restyle_pending && !gtk_widget_needs_allocate (GTK_WIDGET (container))) { _gtk_container_stop_idle_sizer (container); } @@ -2074,11 +2072,8 @@ gtk_container_queue_resize_handler (GtkContainer *container) switch (container->priv->resize_mode) { case GTK_RESIZE_QUEUE: - if (!container->priv->resize_pending) - { - container->priv->resize_pending = TRUE; - gtk_container_start_idle_sizer (container); - } + if (gtk_widget_needs_allocate (widget)) + gtk_container_start_idle_sizer (container); break; case GTK_RESIZE_IMMEDIATE: @@ -2112,7 +2107,10 @@ _gtk_container_queue_restyle (GtkContainer *container) void _gtk_container_maybe_start_idle_sizer (GtkContainer *container) { - if (container->priv->restyle_pending || container->priv->resize_pending) + if (!GTK_IS_RESIZE_CONTAINER (container)) + return; + + if (container->priv->restyle_pending || gtk_widget_needs_allocate (GTK_WIDGET (container))) gtk_container_start_idle_sizer (container); } |