ListView not rendering all the rows?

Hi Guys, I’m working on a rather complex listview with a GtkTreeListModel and when filling the model with random test data I’ve found this issue:

It looks like the listview isn’t rendering all the rows, or triggering a re-render as I scroll. Any ideas what could be causing this? I’ve been at this for a while

Relevant code is here:


row.get_item() in gtk 4.8 doesn’t work as expected (e.g. when sorting), it should be fixed in 4.10.

Hey, thanks for replying but I’m running Fedora 38 (GTK 4.10)

Hi diego,
I tried to reproduce the bug you are describing on your gtk4 branch, but so far I did not encountered glitches, even if I am not sure what to expect and how to provoke it :slight_smile:

  • GTG (debug version, “random” dataset) v0.6-296-gfe121e84
  • CPython 3.11.3 (main, Apr 5 2023, 15:52:25) [GCC 12.2.1 20230201]
  • GTK 4.10.4, GLib 2.76.2
  • PyGLib 3.44.1, PyGObject 3.44.1
  • Linux-6.3.6-arch1-1-x86_64-with-glibc2.37

Thanks. I’ve noticed that it happens at around +204 tasks. If you have 205 for instance, you’ll see an empty row at the bottom. At 206, you’ll see two and so on.

It appears to be the box between the scrolled window and the list view itself to be the problem.

The following patch makes it work for me:

diff --git a/GTG/gtk/browser/ b/GTG/gtk/browser/
index 303cd966..4c2c2e58 100644
--- a/GTG/gtk/browser/
+++ b/GTG/gtk/browser/
@@ -204,9 +204,12 @@ class TaskPane(Gtk.ScrolledWindow):
         view.connect('activate', self.on_listview_activated)
-        wrap_box.append(title_box)
-        wrap_box.append(view)
-        self.set_child(wrap_box)
+        if False:
+            wrap_box.append(title_box)
+            wrap_box.append(view)
+            self.set_child(wrap_box)
+        else:
+            self.set_child(view)

I created an example program that shows the problem, and the issue indeed appears at around 205 entries.

1 Like

That was it, thanks man!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.