From: Corey Berla Date: Mon, 25 Jul 2022 22:35:20 +0000 (-0700) Subject: gridview: Allow starting rubberband in empty space below last row X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2~4^2~38^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1e9a36ffa8d198212cde130a021256fd142ba6c5;p=gtk4.git gridview: Allow starting rubberband in empty space below last row Rubberband does not work when initiated past the last row (warning is printed "Could not start rubberbanding: No item). Clamp y at the max height of the widgets in the gridview Fixes: #3462 --- diff --git a/gtk/gtkgridview.c b/gtk/gtkgridview.c index c2a4abe9d2..869f4be206 100644 --- a/gtk/gtkgridview.c +++ b/gtk/gtkgridview.c @@ -441,6 +441,7 @@ gtk_grid_view_get_position_from_allocation (GtkListBase *base, return FALSE; n_items = gtk_list_base_get_n_items (base); + along = CLAMP (along, 0, gtk_grid_view_compute_total_height (self) - 1); if (!gtk_grid_view_get_cell_at_y (self, along, &pos,