Skip to content

st: Ensure to reset all widget theme nodes

Carlos Garnacho requested to merge wip/carlosg/invalidate-styles into master

Theme node invalidation stops at unmapped widgets, and widgets that forget to chain up to the default ::style-changed implementation. This may leave stale nodes that were invalidated on StThemeContext::changed, but are still set on widgets, and maybe used for CSS property lookups.

Make it sure that theme node invalidation happens always by moving propagation outside the vfunc, and ensure the theme nodes are reset across the full actor tree. Emission of ::style-changed, and obtaining a new theme node may be delayed till when the actor is mapped.

The theme node is also cleared after unparenting an actor to avoid stale references.

This ensures that all widgets get their theme node cleared after stylesheet changes, instead of maybe being left with a theme node that's been cleared of all its properties.

Fixes: #2541 (closed)

Edited by Carlos Garnacho

Merge request reports