Compare commits

...

1 Commits

Author SHA1 Message Date
Matthias Clasen
34e365e11a listbase: Don't hand out invalid positions
gtk_list_base_get_position_from_allocation relies on
the rbtree allocations being valid, and thus can't really
be used more than once before doing a size_allocate. We
generally queue a resize when we invalidate the rbtree
in response to handling input events, so we can use the
resize_needed flag as a proxy for the tree being invalid.

This change prevents the jumpy scrolling that is currently
happening when we manage to get two scroll events during
a single frame cycle, where the scrollbar sometimes jumps
to the other end of a long list.
2020-11-02 08:11:35 -05:00

View File

@@ -132,6 +132,9 @@ gtk_list_base_get_position_from_allocation (GtkListBase *self,
guint *pos,
cairo_rectangle_int_t *area)
{
if (widget->priv->resize_needed)
return FALSE;
return GTK_LIST_BASE_GET_CLASS (self)->get_position_from_allocation (self, across, along, pos, area);
}