diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-03-29 13:27:40 -0400 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-03-29 13:27:40 -0400 |
commit | b4d09fd5fb5491bfeda98fd5767206c503a5ee18 (patch) | |
tree | 112655fba7af037af27b8e1f58373846278681fe | |
parent | 7e43059e841d0455227e6e64b4853700d8df89c4 (diff) | |
download | gdk-pixbuf-b4d09fd5fb5491bfeda98fd5767206c503a5ee18.tar.gz |
Fixed possible devision by zero in size negotiations
Fixed GtkToolItemGroup to avoid deviding by zero when all children
are invisible or there are no children. bgo #613974.
-rw-r--r-- | gtk/gtktoolitemgroup.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c index a3d75b756..0107b0f00 100644 --- a/gtk/gtktoolitemgroup.c +++ b/gtk/gtktoolitemgroup.c @@ -631,6 +631,9 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget, else item_size.height = MIN (item_size.height, allocation->height); + item_size.width = MAX (item_size.width, 1); + item_size.height = MAX (item_size.height, 1); + item_area.width = 0; item_area.height = 0; @@ -903,6 +906,9 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget, /* figure out the size of homogeneous items */ gtk_tool_item_group_get_item_size (group, &item_size, TRUE, &min_rows); + item_size.width = MAX (item_size.width, 1); + item_size.height = MAX (item_size.height, 1); + /* figure out the available columns and size of item_area */ if (GTK_ORIENTATION_VERTICAL == orientation) { |