[gtk+/wip/cssvalue: 145/165] container: Remove duplicated flag



commit 6c85682741e9ce5e51b43af2959008036dcb5e75
Author: Benjamin Otte <otte redhat com>
Date:   Mon Apr 9 20:53:37 2012 +0200

    container: Remove duplicated flag
    
    GtkContainer::need_resize and GtkWidget::alloc_needed are the same
    thing.

 gtk/gtkcontainer.c        |   23 -----------------------
 gtk/gtkcontainerprivate.h |    3 ---
 gtk/gtkoffscreenwindow.c  |    5 +----
 gtk/gtkwindow.c           |    3 +--
 4 files changed, 2 insertions(+), 32 deletions(-)
---
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index caeb2a5..75c7d53 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -238,7 +238,6 @@ struct _GtkContainerPrivate
   guint border_width : 16;
 
   guint has_focus_chain    : 1;
-  guint need_resize        : 1;
   guint reallocate_redraws : 1;
   guint resize_mode        : 2;
   guint request_mode       : 2;
@@ -1342,7 +1341,6 @@ gtk_container_init (GtkContainer *container)
 
   priv->focus_child = NULL;
   priv->border_width = 0;
-  priv->need_resize = FALSE;
   priv->resize_mode = GTK_RESIZE_PARENT;
   priv->reallocate_redraws = FALSE;
 }
@@ -1724,14 +1722,6 @@ _gtk_container_queue_resize_internal (GtkContainer *container,
               break;
             }
         }
-      else
-        {
-          /* we need to let hidden resize containers know that something
-           * changed while they where hidden (currently only evaluated by
-           * toplevels).
-           */
-          GTK_CONTAINER (widget)->priv->need_resize = TRUE;
-        }
     }
 }
 
@@ -3347,19 +3337,6 @@ gtk_container_propagate_draw (GtkContainer   *container,
 }
 
 gboolean
-_gtk_container_get_need_resize (GtkContainer *container)
-{
-  return container->priv->need_resize;
-}
-
-void
-_gtk_container_set_need_resize (GtkContainer *container,
-                                gboolean      need_resize)
-{
-  container->priv->need_resize = need_resize;
-}
-
-gboolean
 _gtk_container_get_reallocate_redraws (GtkContainer *container)
 {
   return container->priv->reallocate_redraws;
diff --git a/gtk/gtkcontainerprivate.h b/gtk/gtkcontainerprivate.h
index d5a7e9f..f96ae0b 100644
--- a/gtk/gtkcontainerprivate.h
+++ b/gtk/gtkcontainerprivate.h
@@ -34,9 +34,6 @@ GList *  _gtk_container_focus_sort             (GtkContainer     *container,
                                                 GList            *children,
                                                 GtkDirectionType  direction,
                                                 GtkWidget        *old_focus);
-gboolean _gtk_container_get_need_resize        (GtkContainer *container);
-void     _gtk_container_set_need_resize        (GtkContainer *container,
-                                                gboolean      need_resize);
 gboolean _gtk_container_get_reallocate_redraws (GtkContainer *container);
 
 
diff --git a/gtk/gtkoffscreenwindow.c b/gtk/gtkoffscreenwindow.c
index 9a86e2b..e5a33cc 100644
--- a/gtk/gtkoffscreenwindow.c
+++ b/gtk/gtkoffscreenwindow.c
@@ -220,13 +220,10 @@ static void
 gtk_offscreen_window_show (GtkWidget *widget)
 {
   gboolean need_resize;
-  GtkContainer *container;
 
   _gtk_widget_set_visible_flag (widget, TRUE);
 
-  container = GTK_CONTAINER (widget);
-  need_resize = _gtk_container_get_need_resize (container) || !gtk_widget_get_realized (widget);
-  _gtk_container_set_need_resize (container, FALSE);
+  need_resize = _gtk_widget_get_alloc_needed (widget) || !gtk_widget_get_realized (widget);
 
   if (need_resize)
     gtk_offscreen_window_resize (widget);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 023416c..bffca64 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4805,8 +4805,7 @@ gtk_window_show (GtkWidget *widget)
 
   _gtk_widget_set_visible_flag (widget, TRUE);
 
-  need_resize = _gtk_container_get_need_resize (container) || !gtk_widget_get_realized (widget);
-  _gtk_container_set_need_resize (container, FALSE);
+  need_resize = _gtk_widget_get_alloc_needed (widget) || !gtk_widget_get_realized (widget);
 
   if (need_resize)
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]