]> Pileus Git - ~andy/gtk/commitdiff
also copy icon factories and color hashes. Fixes bug #357132.
authorMichael Natterer <mitch@imendio.com>
Fri, 22 Sep 2006 20:47:23 +0000 (20:47 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Fri, 22 Sep 2006 20:47:23 +0000 (20:47 +0000)
2006-09-22  Michael Natterer  <mitch@imendio.com>

* gtk/gtkstyle.c (gtk_style_real_copy): also copy icon factories
and color hashes. Fixes bug #357132.

ChangeLog
gtk/gtkstyle.c

index 0ae3fb36425d55830c05f7fd982ba2af25f248a4..9f41cf2bfd417f2753641327ebc60659a30f0783 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-22  Michael Natterer  <mitch@imendio.com>
+
+       * gtk/gtkstyle.c (gtk_style_real_copy): also copy icon factories
+       and color hashes. Fixes bug #357132.
+
 2006-09-22  Matthias Clasen  <mclasen@redhat.com>
 
        Make remote bookmarks work better (#354887)
@@ -42,7 +47,7 @@
        over the FG and BG colors (they can't be set separately any more).
 
        The stipple mask part of the patch doesn't work but seems to take
-       the right approach and doesn't make things worse, so i applied it.
+       the right approach and doesn't make things worse, so I applied it.
 
        Did *not* apply the clipping part of the patch since I don't
        understand it (I don't understand the version in CVS either, but
index fed5bf7a89b27a8a73f1a51fc69d03f4150a40a5..0b56a0bbc42435d728ecf9db54c41b36212d3d5e 100644 (file)
@@ -1583,6 +1583,8 @@ static void
 gtk_style_real_copy (GtkStyle *style,
                     GtkStyle *src)
 {
+  GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style);
+  GtkStylePrivate *src_priv = GTK_STYLE_GET_PRIVATE (src);
   gint i;
   
   for (i = 0; i < 5; i++)
@@ -1621,6 +1623,16 @@ gtk_style_real_copy (GtkStyle *style,
   if (src->rc_style)
     g_object_ref (src->rc_style);
 
+  g_slist_foreach (style->icon_factories, (GFunc) g_object_unref, NULL);
+  g_slist_free (style->icon_factories);
+  style->icon_factories = g_slist_copy (src->icon_factories);
+  g_slist_foreach (style->icon_factories, (GFunc) g_object_ref, NULL);
+
+  g_slist_foreach (priv->color_hashes, (GFunc) g_hash_table_unref, NULL);
+  g_slist_free (priv->color_hashes);
+  priv->color_hashes = g_slist_copy (src_priv->color_hashes);
+  g_slist_foreach (priv->color_hashes, (GFunc) g_hash_table_ref, NULL);
+
   /* don't copy, just clear cache */
   clear_property_cache (style);
 }