Items are added in GtkTreeListModel in reverse order
Steps to reproduce
- Have a GListModel that can update several items at once
- Create a GtkTreeListModel with it
- Trigger the "items-changed" signal on the first model with
added > 1
It can be reproduced with this patch that adds a test for splicing the underlying list model: 0001-Add-a-test-for-splicing-treelistmodel.patch
Current behavior
When items 1, 2, 3, 4, 5
are added at a given position, the GtkTreeListModel exposes them in the order 5, 4, 3, 2, 1
, starting at the same position.
Expected outcome
The items should be exposed in the same order as the underlying list model.
Version information
- GTK 4.11.1 (main) built with JHBuild
- Fedora 37 Silverblue
Additional information
We noticed it in Fractal 4 days ago, on the nightly GNOME flatpak runtime. It occurs in the sidebar where the rooms are ordered by latest activity. It might have been there for a few days before that, since the ordering has been broken for a while.
Edited by Kévin Commaille