[gtk+] headerbar: Don't add hidden widgets



commit cf8fb209e3dfde23a1ebf77eb28335ae00150e88
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Dec 13 01:11:27 2013 -0500

    headerbar: Don't add hidden widgets
    
    This is a much simpler fix.

 gtk/gtkheaderbar.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index 0b20076..70a77d7 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -359,12 +359,16 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
               if (strcmp (t[j], "icon") == 0)
                 {
                   button = gtk_image_new ();
+                  priv->titlebar_icon = button;
                   gtk_style_context_add_class (gtk_widget_get_style_context (button), "titlebutton");
                   gtk_widget_set_size_request (button, 20, 20);
                   gtk_widget_show (button);
-                  priv->titlebar_icon = button;
                   if (!_gtk_header_bar_update_window_icon (bar, window))
-                    gtk_widget_hide (button);
+                    {
+                      gtk_widget_destroy (button);
+                      priv->titlebar_icon = NULL;
+                      button = NULL;
+                    }
                 }
               else if (strcmp (t[j], "menu") == 0 && menu != NULL)
                 {


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