paned: Properly hide panes that were set to invisible

Gets rid of random windows when hiding the Totem statusbar.
This commit is contained in:
Benjamin Otte 2011-06-02 22:06:15 +02:00
parent fdf979dce2
commit 0ba14bb256

View File

@ -1224,11 +1224,6 @@ gtk_paned_size_allocate (GtkWidget *widget,
if (gtk_widget_get_realized (widget)) if (gtk_widget_get_realized (widget))
gdk_window_hide (priv->handle); gdk_window_hide (priv->handle);
if (priv->child1)
gtk_paned_set_child_visible (paned, 0, TRUE);
if (priv->child2)
gtk_paned_set_child_visible (paned, 1, TRUE);
window_allocation.x = allocation->x; window_allocation.x = allocation->x;
window_allocation.y = allocation->y; window_allocation.y = allocation->y;
window_allocation.width = allocation->width; window_allocation.width = allocation->width;
@ -1239,6 +1234,10 @@ gtk_paned_size_allocate (GtkWidget *widget,
if (priv->child1 && gtk_widget_get_visible (priv->child1)) if (priv->child1 && gtk_widget_get_visible (priv->child1))
{ {
gtk_paned_set_child_visible (paned, 0, TRUE);
if (priv->child2)
gtk_paned_set_child_visible (paned, 1, FALSE);
gtk_paned_child_allocate (priv->child1, gtk_paned_child_allocate (priv->child1,
priv->child1_window, priv->child1_window,
&window_allocation, &window_allocation,
@ -1246,11 +1245,22 @@ gtk_paned_size_allocate (GtkWidget *widget,
} }
else if (priv->child2 && gtk_widget_get_visible (priv->child2)) else if (priv->child2 && gtk_widget_get_visible (priv->child2))
{ {
gtk_paned_set_child_visible (paned, 1, TRUE);
if (priv->child1)
gtk_paned_set_child_visible (paned, 0, FALSE);
gtk_paned_child_allocate (priv->child2, gtk_paned_child_allocate (priv->child2,
priv->child2_window, priv->child2_window,
&window_allocation, &window_allocation,
&child_allocation); &child_allocation);
} }
else
{
if (priv->child1)
gtk_paned_set_child_visible (paned, 0, FALSE);
if (priv->child2)
gtk_paned_set_child_visible (paned, 1, FALSE);
}
} }
} }