diff options
author | Matthias Clasen <mclasen@redhat.com> | 2009-10-25 23:47:59 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2009-10-25 23:47:59 -0400 |
commit | d3e6cffff7be51748eac859850c24cd1075795f9 (patch) | |
tree | 0b88fea1076e8a167707e63fc83fc32a2d4b5430 /gtk/gtkrc.c | |
parent | 16482f20db0596851f3b43cc167df2a464115822 (diff) | |
download | gtk+-d3e6cffff7be51748eac859850c24cd1075795f9.tar.gz |
Fix issues with symbolic colors in rc file parsing
Don't recreate the settings color hash every time, repopulate it
instead. This avoids invalidating the references held by RcContexts.
Diffstat (limited to 'gtk/gtkrc.c')
-rw-r--r-- | gtk/gtkrc.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c index a2ac58b932..70540a3130 100644 --- a/gtk/gtkrc.c +++ b/gtk/gtkrc.c @@ -659,11 +659,15 @@ gtk_rc_color_hash_changed (GtkSettings *settings, GParamSpec *pspec, GtkRcContext *context) { - if (context->color_hash) - g_hash_table_unref (context->color_hash); - + GHashTable *old_hash; + + old_hash = context->color_hash; + g_object_get (settings, "color-hash", &context->color_hash, NULL); + if (old_hash) + g_hash_table_unref (old_hash); + gtk_rc_reparse_all_for_settings (settings, TRUE); } @@ -3148,8 +3152,10 @@ gtk_rc_parse_style (GtkRcContext *context, break; case GTK_RC_TOKEN_COLOR: if (our_hash == NULL) - gtk_rc_style_prepend_empty_color_hash (rc_style); - our_hash = rc_priv->color_hashes->data; + { + gtk_rc_style_prepend_empty_color_hash (rc_style); + our_hash = rc_priv->color_hashes->data; + } token = gtk_rc_parse_logical_color (scanner, rc_style, our_hash); break; case G_TOKEN_IDENTIFIER: |