Skip to content

widget: Change CSS node visibility with child_visible

When using gtk_widget_set_child_visible () to (not) map it along with the widget's parent, the visibility of the CSS node is not changed. This causes issues with selectors like :first-child and :last-child, as they rely on the node visibility for their heuristics, even if the widget is not currently visible.

Let's also set CSS node visibility in gtk_widget_set_child_visible (), just like with gtk_widget_set_visible ().

Fixes #3375 #4523 #5309 (closed)

See also This problem mainly shows up publicly for the boxed-list style:
gnome-control-center#1644
gnome-control-center#1735 (closed)
gnome-control-center#2193 (closed)
gnome-control-center#2798

The issues that are fixed used workarounds, the open ones are solved by this MR.

This makes !6308 obsolete.

Merge request reports