[SF#660]Fix: PanelIconGrid cannot be shown again when children come 0 -> 1.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Wed, 20 Aug 2014 20:51:48 +0000 (23:51 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Wed, 20 Aug 2014 20:51:48 +0000 (23:51 +0300)
It was not correct to call gtk_widget_show()/gtk_widget_hide() in the
size request callback.

Makefile.am
src/icon-grid.c
src/misc.c

index 16faf1a..43a28e0 100644 (file)
@@ -14,12 +14,6 @@ EXTRA_DIST = \
 pkgconfigdir   = $(libdir)/pkgconfig
 pkgconfig_DATA = lxpanel.pc
 
-##desktopdir = $(datadir)/applications
-##desktop_DATA = pcmanfm.desktop
-
-## icondir = $(datadir)/pixmaps
-## icon_DATA = data/pcmanfm.png
-
 install-data-local:
        @$(NORMAL_INSTALL)
        if test -d $(srcdir)/pixmaps; then \
@@ -40,4 +34,3 @@ dist-hook:
            fi \
          done \
        fi
-
index 36378bd..589513f 100644 (file)
@@ -235,9 +235,8 @@ static void panel_icon_grid_size_request(GtkWidget *widget,
     /* Compute the requisition. */
     if ((ig->columns == 0) || (ig->rows == 0))
     {
-        requisition->width = 1;
-        requisition->height = 1;
-        gtk_widget_hide(widget);       /* Necessary to get the plugin to disappear */
+        requisition->width = 0;
+        requisition->height = 0;
     }
     else
     {
@@ -247,7 +246,6 @@ static void panel_icon_grid_size_request(GtkWidget *widget,
         if (row_spaces < 0) row_spaces = 0;
         requisition->width = ig->child_width * ig->columns + column_spaces * ig->spacing + 2 * border;
         requisition->height = ig->child_height * ig->rows + row_spaces * ig->spacing + 2 * border;
-        gtk_widget_show(widget);
     }
     if (ig->rows != old_rows || ig->columns != old_columns)
         gtk_widget_queue_resize(widget);
@@ -276,7 +274,7 @@ static void panel_icon_grid_add(GtkContainer *container, GtkWidget *widget)
     g_signal_connect(G_OBJECT(widget), "size-request",
                      G_CALLBACK(icon_grid_element_size_request), container);
     gtk_widget_set_parent(widget, GTK_WIDGET(container));
-    gtk_widget_queue_resize(GTK_WIDGET(container));
+//    gtk_widget_queue_resize(GTK_WIDGET(container));
 }
 
 void panel_icon_grid_set_constrain_width(PanelIconGrid * ig, gboolean constrain_width)
index adb396d..fb16893 100644 (file)
@@ -1030,8 +1030,6 @@ void
 get_button_spacing(GtkRequisition *req, GtkContainer *parent, gchar *name)
 {
     GtkWidget *b;
-    //gint focus_width;
-    //gint focus_pad;
 
     ENTER;
     b = gtk_button_new();