GNOME Bugzilla – Bug 144706
Funniness with gtk_style_attach()
Last modified: 2004-12-22 21:47:04 UTC
gtk_style_attach(), in a single loop, looks for: - Unattached styles - Styles with the right colormap Meaning that if a unattached style is before the matching style, then it realize the unattached style instead of picking up the correct one. So, it needs a double loop; sort of described in the FIXME for gtk_style_attach(), which is however out of sync with the current code. I don't think this comes up very often since unattached styles generally are going to simply be freed and finalized. Also, the tricky handling of the style->styles list really could use a comment or two; it looks correct to me, but it's far from transparent. [ The way it works is that all the styles in the list have the same style->styles pointer, when we insert a new style, we append it to the list to avoid having to update the existing ones. If we delete the *first* style from the list in gtk_style_finalize(), we need to update the style->styles pointers from all the styles, but otherwise we simply remove the node from the list. One comment in gtk_style_duplicate() one comment in gtk_style_finalize() woudl probably help people reading the code ]