

You can see this in the example, where the box was given enough space for 3, 4, 5 or 6 lines of text.

GTK 4.6 will query the children for their actual size to decide which child to distribute how much of the extra size to. In GTK 4.4, size was always distributed equally among children that had the same default size. GtkBox has learned to assign size to widgets as needed. So update the other dimension to not be the default fill and you should get the old behavior back. If you do not use fill in either direction, the behavior will be as before. This makes the widget thinner but avoids extra space.Ī centered label with empty space in GTK 4.4Ī centered label with no extra space in GTK 4.6 What if you like the old behavior? In GTK 4.6, GTK will measure the size of the other dimension relative to the filled dimension. This leaves a lot of extra space when one of the values was set to fill. When using the GtkWidget::halign or GtkWidget::valign properties, GTK 4.4 would look at the default size of the widget and then place the widget accordingly. For the upcoming GTK 4.6, we have overhauled a lot of the sizing infrastructure to make widgets fit even tighter and to make sure our sizing infrastructure actually does what it says.
