Skip to content

AdwCarousel: fix scrolling to a recently inserted item

Nelson Ben requested to merge fix_carousel_scroll_to into main

When doing these consecutive calls:

adw_carousel_insert (carousel, widget, position);
adw_carousel_scroll_to (carousel, widget, animate);

the last one will fail to scroll because widget is still being allocated/resized by GTK async machinery.

To fix it we detect when that case happens and then do the scroll_to() in an idle handler, which will get executed after GTK has finished allocating/resizing widget.

Fixes #597 (closed)

Merge request reports