diff options
author | Matthias Clasen <mclasen@redhat.com> | 2011-05-12 20:12:51 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2011-05-12 20:12:51 -0400 |
commit | b219b3b0ecc9803eb9daaf1f041d33cb9da8074b (patch) | |
tree | 3ff29f44b7995aa545cb10711126146019fa2c53 /gtk/gtkgrid.c | |
parent | 76a96626fd972e610749ef1edd85bbffaf90cf4d (diff) | |
download | gtk+-b219b3b0ecc9803eb9daaf1f041d33cb9da8074b.tar.gz |
Add shortcuts for the !children case
Not that we are doing too much work in that case, but we are
segfaulting, which is bad.
https://bugzilla.gnome.org/show_bug.cgi?id=649972
Diffstat (limited to 'gtk/gtkgrid.c')
-rw-r--r-- | gtk/gtkgrid.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c index f202bb4f84..e1c56f948f 100644 --- a/gtk/gtkgrid.c +++ b/gtk/gtkgrid.c @@ -1048,6 +1048,15 @@ gtk_grid_get_size (GtkGrid *grid, GtkGridRequest request; GtkGridLines *lines; + if (minimum) + *minimum = 0; + + if (natural) + *natural = 0; + + if (grid->priv->children == NULL) + return; + request.grid = grid; gtk_grid_request_count_lines (&request); lines = &request.lines[orientation]; @@ -1069,6 +1078,15 @@ gtk_grid_get_size_for_size (GtkGrid *grid, GtkGridLines *lines; gint min_size; + if (minimum) + *minimum = 0; + + if (natural) + *natural = 0; + + if (grid->priv->children == NULL) + return; + request.grid = grid; gtk_grid_request_count_lines (&request); lines = &request.lines[0]; @@ -1214,6 +1232,12 @@ gtk_grid_size_allocate (GtkWidget *widget, GtkGridRequest request; GtkGridLines *lines; + if (priv->children == NULL) + { + gtk_widget_set_allocation (widget, allocation); + return; + } + request.grid = grid; gtk_grid_request_count_lines (&request); |