container: needs_resize is a container flag, not a widget flag

The widget flag is alloc_needed, needs_resize is used for "is queued
into the container resize queue".
This commit is contained in:
Benjamin Otte 2012-04-13 16:51:19 +02:00
parent 53e714199a
commit 17ccbe4843
3 changed files with 10 additions and 30 deletions

View File

@ -239,6 +239,7 @@ struct _GtkContainerPrivate
guint has_focus_chain : 1;
guint reallocate_redraws : 1;
guint resize_pending : 1;
guint resize_mode : 2;
guint request_mode : 2;
};
@ -1351,7 +1352,7 @@ gtk_container_destroy (GtkWidget *widget)
GtkContainer *container = GTK_CONTAINER (widget);
GtkContainerPrivate *priv = container->priv;
if (_gtk_widget_get_resize_pending (GTK_WIDGET (container)))
if (priv->resize_pending)
_gtk_container_dequeue_resize_handler (container);
if (priv->focus_child)
@ -1542,10 +1543,10 @@ void
_gtk_container_dequeue_resize_handler (GtkContainer *container)
{
g_return_if_fail (GTK_IS_CONTAINER (container));
g_return_if_fail (_gtk_widget_get_resize_pending (GTK_WIDGET (container)));
g_return_if_fail (container->priv->resize_pending);
container_resize_queue = g_slist_remove (container_resize_queue, container);
_gtk_widget_set_resize_pending (GTK_WIDGET (container), FALSE);
container->priv->resize_pending = FALSE;
}
/**
@ -1650,15 +1651,15 @@ gtk_container_idle_sizer (gpointer data)
while (container_resize_queue)
{
GtkWidget *widget;
GtkContainer *container;
slist = container_resize_queue;
container_resize_queue = slist->next;
widget = slist->data;
container = slist->data;
g_slist_free_1 (slist);
_gtk_widget_set_resize_pending (widget, FALSE);
gtk_container_check_resize (GTK_CONTAINER (widget));
container->priv->resize_pending = FALSE;
gtk_container_check_resize (container);
}
gdk_window_process_all_updates ();
@ -1682,9 +1683,9 @@ _gtk_container_queue_resize_handler (GtkContainer *container)
switch (container->priv->resize_mode)
{
case GTK_RESIZE_QUEUE:
if (!_gtk_widget_get_resize_pending (widget))
if (!container->priv->resize_pending)
{
_gtk_widget_set_resize_pending (widget, TRUE);
container->priv->resize_pending = TRUE;
if (container_resize_queue == NULL)
gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE,
gtk_container_idle_sizer,

View File

@ -342,7 +342,6 @@ struct _GtkWidgetPrivate
guint in_reparent : 1;
/* Queue-resize related flags */
guint resize_pending : 1;
guint alloc_needed : 1;
guint width_request_needed : 1;
guint height_request_needed : 1;
@ -8573,10 +8572,6 @@ gtk_widget_verify_invariants (GtkWidget *widget)
#if 0
/* widget_system.txt says these hold, but they don't. */
if (widget->priv->resize_pending)
g_warning ("%s %p resize pending but not realized",
G_OBJECT_TYPE_NAME (widget), widget);
if (widget->priv->alloc_needed)
g_warning ("%s %p alloc needed but not realized",
G_OBJECT_TYPE_NAME (widget), widget);
@ -13697,19 +13692,6 @@ gtk_widget_in_destruction (GtkWidget *widget)
return widget->priv->in_destruction;
}
gboolean
_gtk_widget_get_resize_pending (GtkWidget *widget)
{
return widget->priv->resize_pending;
}
void
_gtk_widget_set_resize_pending (GtkWidget *widget,
gboolean resize_pending)
{
widget->priv->resize_pending = resize_pending;
}
gboolean
_gtk_widget_get_in_reparent (GtkWidget *widget)
{

View File

@ -67,9 +67,6 @@ typedef struct {
void _gtk_widget_set_visible_flag (GtkWidget *widget,
gboolean visible);
gboolean _gtk_widget_get_resize_pending (GtkWidget *widget);
void _gtk_widget_set_resize_pending (GtkWidget *widget,
gboolean resize_pending);
gboolean _gtk_widget_get_in_reparent (GtkWidget *widget);
void _gtk_widget_set_in_reparent (GtkWidget *widget,
gboolean in_reparent);