diff --git a/gtk/gtkgridview.c b/gtk/gtkgridview.c index ce1bf083af..b2636c915a 100644 --- a/gtk/gtkgridview.c +++ b/gtk/gtkgridview.c @@ -743,7 +743,7 @@ gtk_grid_view_size_allocate (GtkWidget *widget, int baseline) { GtkGridView *self = GTK_GRID_VIEW (widget); - GtkListTile *tile, *start; + GtkListTile *tile, *start, *footer; GArray *heights; int min_row_height, unknown_row_height, row_height, col_min, col_nat; GtkOrientation orientation; @@ -880,11 +880,11 @@ gtk_grid_view_size_allocate (GtkWidget *widget, i = 0; } } - /* Add a filler tile for empty space in the bottom right */ + footer = gtk_list_item_manager_get_last (self->item_manager); + g_assert (gtk_list_tile_is_footer (footer)); + /* Make the footer tile fill the empty space in the bottom right */ if (i > 0) { - GtkListTile *footer = gtk_list_item_manager_get_last (self->item_manager); - g_assert (gtk_list_tile_is_footer (footer)); tile = gtk_rb_tree_node_get_previous (footer); gtk_list_tile_set_area_position (self->item_manager, footer, @@ -895,8 +895,15 @@ gtk_grid_view_size_allocate (GtkWidget *widget, column_end (self, xspacing, self->n_columns - 1) - footer->area.x, tile->area.height); } + else + { + gtk_list_tile_set_area_size (self->item_manager, + footer, + 0, + 0); + } - /* step 4: allocate the rest */ + /* step 5: allocate the rest */ gtk_list_base_allocate (GTK_LIST_BASE (self)); }