From: Corey Berla Date: Tue, 26 Jul 2022 00:00:46 +0000 (-0700) Subject: listview: 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~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d6fab1408a10f9bc431af6e4dacf73bfbb481fd6;p=gtk4.git 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 --- 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;