The guards weren't working because we were accessing data inside the
arguments before checking them. Postpone data access until after the
guards.
0x00007ffff741203c in gtk_box_pack (box=box@entry=0x0, child=0xe0b1b0, expand=expand@entry=0, fill=fill@entry=0, padding=padding@entry=0, pack_type=pack_type@entry=GTK_PACK_START)
at /usr/src/debug/gtk3-3.24.28-2.fc34.x86_64/gtk/gtkbox.c:1530
1530 GtkBoxPrivate *private = box->priv;
(gdb) bt
#0 0x00007ffff741203c in gtk_box_pack (box=box@entry=0x0, child=0xe0b1b0, expand=expand@entry=0, fill=fill@entry=0, padding=padding@entry=0, pack_type=pack_type@entry=GTK_PACK_START)
at /usr/src/debug/gtk3-3.24.28-2.fc34.x86_64/gtk/gtkbox.c:1530
#1 0x00007ffff741223c in gtk_box_pack_start (box=box@entry=0x0, child=<optimized out>, expand=expand@entry=0, fill=fill@entry=0, padding=padding@entry=0)
at /usr/src/debug/gtk3-3.24.28-2.fc34.x86_64/gtk/gtkbox.c:2179
They're either wrong (when using FALSE because the widgets don't account
for changes to the CSS) or unnecessary (when using TRUE because it's the
default).
Fixes!1777
Issue #1495 showed that the docs of GtkGrid retain outdated implications
that (as was once, but is no longer, the case) it is intended to replace
GtkBox, by discussing HfW and widget properties in a way that suggests
GtkBox can't handle them. But of course it does, and it's preferable for
simple single-row/column cases. Worse, we said GtkGrid “provides exactly
the same functionality” for the latter case, but the original point of
that Issues was that it doesn’t, at least for CSS positional selectors!
Box:
• Use an actually meaningful @Short_description.
• Remove unhelpful @See_also references to unrelated containers.
• Remove references to “rectangular area”: it might be another shape
via CSS, or “rectangular” might falsely imply 2 dimensions of children.
• Mention Orientable:orientation.
• Emphasise usefulness of :[hv]align for allocating in the other axis.
• Don’t say that Grid “provides exactly the same functionality” for a
single row or column, since (A) it is overkill for that case and (B)
said Issue proved that it *doesn’t* for CSS child order, for example.
• Note in the child properties that are remove in master that we have
better, preferred alternatives available now in GtkWidget/CSS props.
There’s no nice way to deprecate these, though they’re gone in GTK+ 4.
• Correct a copy-paste-o from the blurb of :expand to :fill.
Grid:
• Remove references to deprecated widgets: GtkTable and Gtk[HV]Box.
• Don’t dwell on widget properties and height-for-width in a way that
wrongly implies that Box can’t handle those (or Grid can better). In
fact, just get rid of that bit altogether: Box handles them fine, and
Table is so old as to be not worth mentioning (in anything except the
2 => 3 migration guide) and points to Grid in its deprecation notice.
• Point to GtkBox as being preferred for the simple row/column use case.
The code for adjusting the center widget allocation in case
of uneven sides never worked right in RTL. This was finally
noticed for tabs with close button, which commonly use a
centered label.
This reverts commit 572e9a0402.
_gtk_box_get_children was not doing exactly the same than
gtk_container_get_children does, because the latter uses the forall
implementation of GtkBox that takes into account the children pack mode while
the former just iterated the list of children. This broke the order of
the buttons in a GtkButtonBox when they were packaged with PACK_END.
gtk_css_node_set_after/before() are now called
gtk_css_node_insert_after/before().
This brings them in line with other similar APIs (ie GtkListStore). And
it allows easier usage of the API (see changes to gtkbox.c).