GtkListView + ScrolledWindow : scrollbars always visible when all items are removed (gtk4)
Steps to reproduce
- Create a ListView linked to a GtkFilterListModel
- Append this ListView inside a GtkScrolledWindow
- Remove all elements from the model in one go, issue : the scrollbars are still visible
Note: It only happen when removing all items from the model in one go, if I remove them one by one the scrollbar height decrease normally.
Small contained C example in attachment : gtk-listview-scrollbar.zip
Compile and launch with :
meson _build && ninja -C _build && _build/app
- All item are visible :
- Now if we search for a non-existing item name, for example "zzz", all items will be remove from the list, but the scrollbar will still be visible :
Version information
Operating system : Fedora 34
- GTK version: 4.4.0 (as a Meson subproject)
- GLib version: 2.68.4
Additional information
I experience the same issue when running "gtk-demo" : "Lists > Settings" :
And "Lists > Words" :
As you can see in my two previous screenshots, it's not a theme issue, because in both I'm using Adwaita / Adwaita Dark.
Additionally, when scrolling when the are no items, it produces this warning message :
(app:53448): Gtk-WARNING **: 00:35:02.061: GtkListView failed to scroll to given position. Ignoring...
Maybe be related to this issue : #2971 (closed)
Edited by rivetchip