Author: nick
Date: 2007-11-19 14:31:34 +0000 (Mon, 19 Nov 2007)
New Revision: 26380

Modified:
   xfce4-panel/trunk/plugins/systray/xfce-tray-widget.c
Log:
* Handle the child size for hidden panels.


Modified: xfce4-panel/trunk/plugins/systray/xfce-tray-widget.c
===================================================================
--- xfce4-panel/trunk/plugins/systray/xfce-tray-widget.c        2007-11-19 
14:00:34 UTC (rev 26379)
+++ xfce4-panel/trunk/plugins/systray/xfce-tray-widget.c        2007-11-19 
14:31:34 UTC (rev 26380)
@@ -359,8 +359,17 @@
     child_size -= XFCE_TRAY_WIDGET_SPACING * (tray->rows - 1);
     child_size /= tray->rows;
 
-    /* set last allocated child size */
-    tray->last_alloc_child_size = child_size;
+    /* store or fix the calculated child size */
+    if (child_size > 0)
+    {
+        /* set last allocated child size */
+        tray->last_alloc_child_size = child_size;
+    }
+    else
+    {
+        /* child size is invalid (hidden panel), fall-back on old size */
+        child_size = MAX (1, tray->last_alloc_child_size);
+    }
 
     /* position arrow button */
     if (tray->n_hidden_childeren > 0)

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to