Index: gtk/gtkrc.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrc.c,v
retrieving revision 1.169
diff -u -p -r1.169 gtkrc.c
--- gtk/gtkrc.c	12 Dec 2005 15:48:43 -0000	1.169
+++ gtk/gtkrc.c	14 Dec 2005 14:48:34 -0000
@@ -1579,6 +1579,19 @@ gtk_rc_reparse_all_for_settings (GtkSett
 
       gtk_rc_parse_default_files (context);
 
+      g_free (context->theme_name);
+      g_free (context->key_theme_name);
+
+      g_object_get (context->settings,
+		    "gtk-theme-name", &context->theme_name,
+		    "gtk-key-theme-name", &context->key_theme_name,
+		    NULL);
+
+      if (context->theme_name && context->theme_name[0])
+	gtk_rc_parse_named (context, context->theme_name, NULL);
+      if (context->key_theme_name && context->key_theme_name[0])
+	gtk_rc_parse_named (context, context->key_theme_name, "key");
+
       tmp_list = global_rc_files;
       while (tmp_list)
 	{
@@ -1592,19 +1605,6 @@ gtk_rc_reparse_all_for_settings (GtkSett
 	  tmp_list = tmp_list->next;
 	}
 
-      g_free (context->theme_name);
-      g_free (context->key_theme_name);
-
-      g_object_get (context->settings,
-		    "gtk-theme-name", &context->theme_name,
-		    "gtk-key-theme-name", &context->key_theme_name,
-		    NULL);
-
-      if (context->theme_name && context->theme_name[0])
-	gtk_rc_parse_named (context, context->theme_name, NULL);
-      if (context->key_theme_name && context->key_theme_name[0])
-	gtk_rc_parse_named (context, context->key_theme_name, "key");
-      
       g_object_thaw_notify (G_OBJECT (context->settings));
 
       gtk_rc_reset_widgets (context->settings);
