From d6fab1408a10f9bc431af6e4dacf73bfbb481fd6 Mon Sep 17 00:00:00 2001 From: Corey Berla Date: Mon, 25 Jul 2022 17:00:46 -0700 Subject: [PATCH] listview: 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 listview --- gtk/gtklistview.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gtk/gtklistview.c b/gtk/gtklistview.c index a939fdc520..244633fb96 100644 --- a/gtk/gtklistview.c +++ b/gtk/gtklistview.c @@ -428,6 +428,8 @@ gtk_list_view_get_position_from_allocation (GtkListBase *base, if (across >= self->list_width) return FALSE; + along = CLAMP (along, 0, gtk_list_view_get_list_height (self) - 1); + row = gtk_list_view_get_row_at_y (self, along, &remaining); if (row == NULL) return FALSE;