Pressing the Menu key while the view is scrolled down causes the view to jump up, which shouldn't happen.
This happens because of a faulty reimplementation of an edge case handling in the GTK4 port. It's utterly broken and it's my fault.[0,1]
- The index from the selection filter model is wrongly applied to scroll the view (as if it was the index of the unfiltered model);
- If the
forloop runs until the end, the
iis not the index of the last item: it's the length of the filter model.
- For list view, the focus child is the inner list view, not the cell's parent, so this logic would work only in grid.
The first two points are fixable using GtkBitset instead of GtkSelectionFilterModel, but the last point means this would still not work under list view.
The proper solution requires a way to query the focus position, which doesn't exist (yet? ).
Let's give up on the smart handling of corner cases and just get the common case right. Even in the corner cases, this simple solution is not too bad.
Fixes #3095 (closed)