'Gtk4 PyGobject: Trying to snapshot GtkBox without a current allocation

I am developing an app with GTK4 + Python3 and I get this message:

Trying to snapshot GtkBox 0x5594bdcaa310 without a current allocation

It happens when I load a long list of ListBoxItems with an image in each of them. Seems kinda random, and only some of the elements throw a warning.

Sometimes the whole window even freezes, but a resizing it is enough to "unlock it"

Have you have encountered this issue? Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source