diff options
author | Benjamin Otte <otte@redhat.com> | 2011-06-02 22:06:15 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-06-04 21:18:09 +0200 |
commit | 0ba14bb2567ddc97757aac3f7c06413d44cc26ea (patch) | |
tree | 2bba16753bed4894926fa13b4e9c0b81c19e4402 /gtk/gtkpaned.c | |
parent | fdf979dce2423c3b91d3d8579f7b6e12f640c89d (diff) | |
download | gtk+-0ba14bb2567ddc97757aac3f7c06413d44cc26ea.tar.gz |
paned: Properly hide panes that were set to invisible
Gets rid of random windows when hiding the Totem statusbar.
Diffstat (limited to 'gtk/gtkpaned.c')
-rw-r--r-- | gtk/gtkpaned.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index 85c4200ff5..e7b334a65c 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -1224,11 +1224,6 @@ gtk_paned_size_allocate (GtkWidget *widget, if (gtk_widget_get_realized (widget)) 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.y = allocation->y; window_allocation.width = allocation->width; @@ -1239,6 +1234,10 @@ gtk_paned_size_allocate (GtkWidget *widget, 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, priv->child1_window, &window_allocation, @@ -1246,11 +1245,22 @@ gtk_paned_size_allocate (GtkWidget *widget, } 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, priv->child2_window, &window_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); + } } } |