After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 144706 - Funniness with gtk_style_attach()
Funniness with gtk_style_attach()
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.5.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-06-20 17:08 UTC by Owen Taylor
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Owen Taylor 2004-06-20 17:08:31 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 ]