[gnome-control-center] Remove previous panel widget when switching to a new one



commit e178a200c15df44553c981d2005db492ccd4c68e
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Oct 30 23:48:29 2012 +0100

    Remove previous panel widget when switching to a new one
    
    If we don't remove it, it intereferes with the layout of the new panel
    and cause weird overallocation effects.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687232

 shell/gnome-control-center.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c
index bcd34da..99697b9 100644
--- a/shell/gnome-control-center.c
+++ b/shell/gnome-control-center.c
@@ -966,8 +966,6 @@ _shell_set_active_panel_from_id (CcShell      *shell,
       return TRUE;
     }
 
-  g_clear_pointer (&priv->current_panel_id, g_free);
-
   /* clear any custom widgets */
   _shell_remove_all_custom_widgets (priv);
 
@@ -1009,6 +1007,8 @@ _shell_set_active_panel_from_id (CcShell      *shell,
                                              &iter);
     }
 
+  old_panel = priv->current_panel_box;
+
   if (!name)
     {
       g_warning ("Could not find settings panel \"%s\"", start_id);
@@ -1025,7 +1025,12 @@ _shell_set_active_panel_from_id (CcShell      *shell,
     }
   else
     {
+      /* Successful activation */
+      g_free (priv->current_panel_id);
       priv->current_panel_id = g_strdup (start_id);
+
+      if (old_panel)
+        notebook_remove_page (priv->notebook, old_panel);
     }
 
   g_free (name);



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