[gedit] clone window: add checks for existing pages on panels



commit b6ecf3d8e3bc51e369967f397212779f92b241be
Author: Sebastien Lafargue <slafargue src gnome org>
Date:   Fri Mar 7 18:43:36 2014 +0100

    clone window: add checks for existing pages on panels
    
    When cloning a window from a tab, a critical error is triggered
    if we don't have side and/or bottom panel.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725910

 gedit/gedit-window.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index f782d1d..9af0773 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -929,10 +929,18 @@ clone_window (GeditWindow *origin)
        window->priv->bottom_panel_size = origin->priv->bottom_panel_size;
 
        panel_page = gtk_stack_get_visible_child_name (GTK_STACK (origin->priv->side_panel));
-       gtk_stack_set_visible_child_name (GTK_STACK (window->priv->side_panel), panel_page);
 
+       if (panel_page)
+       {
+               gtk_stack_set_visible_child_name (GTK_STACK (window->priv->side_panel), panel_page);
+       }
+       
        panel_page = gtk_stack_get_visible_child_name (GTK_STACK (origin->priv->bottom_panel));
-       gtk_stack_set_visible_child_name (GTK_STACK (window->priv->bottom_panel), panel_page);
+       
+       if (panel_page)
+       {
+               gtk_stack_set_visible_child_name (GTK_STACK (window->priv->bottom_panel), panel_page);
+       }
 
        gtk_widget_set_visible (window->priv->side_panel,
                                gtk_widget_get_visible (origin->priv->side_panel));


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