Commit b4d09fd5 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

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.
parent 7e43059e
...@@ -631,6 +631,9 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget, ...@@ -631,6 +631,9 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget,
else else
item_size.height = MIN (item_size.height, allocation->height); 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.width = 0;
item_area.height = 0; item_area.height = 0;
...@@ -903,6 +906,9 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget, ...@@ -903,6 +906,9 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget,
/* figure out the size of homogeneous items */ /* figure out the size of homogeneous items */
gtk_tool_item_group_get_item_size (group, &item_size, TRUE, &min_rows); 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 */ /* figure out the available columns and size of item_area */
if (GTK_ORIENTATION_VERTICAL == orientation) if (GTK_ORIENTATION_VERTICAL == orientation)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment