#GTK
has a powerful layout system... unfortunately, one of the common things people try to do with it, which is to make their widget have a fixed aspect ratio, perhaps square, like this:
measure (...) {
*minimum = *natural = for_size;
}
does not work like that at all. In fact, ensuring a fixed aspect ratio is non-trivial, even more so if your contents themselves have a minimum size which varies with the available space along the other orientation.
What many folks don't know is that in fact there's a ready-made widget inside GTK for doing just that, and that's Gtk.AspectFrame! You give it a child widget and a desired aspect ratio, and it ensures the child's allocation is proportional to that.
But... it's an old widget, and turns out, it wasn't implemented correctly at all, either. (At least not by GTK 4 layout rules; perhaps what it did could be fine in the past.)