`scroll_to` sometimes changes mapped elements without changing the ScrolledWindow's scroll position
Steps to reproduce
- Call
scroll_to
with a large enough index on a populated gridview right as it is being made visible
Current behavior
Under some conditions, the visible items are wrong and don't match where the ScrolledWindow believes the scroll position is. After scrolling at all, even a tiny amount, the items that should have been visible become visible.
This seems to be very consistent when it does happen, and does not seem to be racy.
Here's an example from a slightly patched (scroll_jank.patch) Colours demo . The bound/visible squares match what they should be if I were scrolled to position 100, more or less (first item is weird), but the ScrolledWindow is still scrolled to the top, showing a bunch of empty space where rows of colours should be.
Expected outcome
The gridview should either scroll to the desired item, or cleanly fail to scroll at all. The gridview and the scrolledwindow should not disagree about what's visible.
Version information
gtk 4.12.5 and gtk 4.13 git head, Fedora 39, X11
Additional information
This might be related to #6501 but scroll_to
is clearly doing something in this case.
Here's what scrolling to the very bottom of the colours list (4095 instead of 100) looks like: