commit 2916514f6631c76df7728ad8979125f5d1905841
Author: Tristan Van Berkom <tristan.van.berkom@gmail.com>
Date:   Tue Jun 15 12:13:41 2010 -0400

    Fixed negative size allocations from gtk_box_size_allocate()
    
    An unchecked devision in the new allocation code was causing
    GtkBox to assign negative sizes to children in some corner
    conditions, this fixes bgo #617444.

diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 3c56196..6c8ef13 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -516,7 +516,7 @@ gtk_box_size_allocate (GtkWidget     *widget,
                * Sort order and reducing remaining space by assigned space
                * ensures that space is distributed equally.
                */
-              gint glue = (size + i) / (i + 1);
+              gint glue = MAX (0, (size + i) / (i + 1));
               gint gap = sizes[spreading[i].index].natural_size
                        - sizes[spreading[i].index].minimum_size;
 
@@ -1052,7 +1052,7 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
                * Sort order and reducing remaining space by assigned space
                * ensures that space is distributed equally.
                */
-              gint glue = (size + i) / (i + 1);
+              gint glue = MAX (0, (size + i) / (i + 1));
               gint gap = sizes[spreading[i].index].natural_size
                        - sizes[spreading[i].index].minimum_size;
 
