--- gtk/gtkicontheme.c.orig 2013-11-11 13:53:39.000000000 +0000 +++ gtk/gtkicontheme.c @@ -1098,6 +1098,8 @@ insert_theme (GtkIconTheme *icon_theme, priv = icon_theme->priv; + GTK_NOTE (ICONTHEME, g_print ("insert_theme %s\n", theme_name)); + for (l = priv->themes; l != NULL; l = l->next) { theme = l->data; @@ -1136,11 +1138,15 @@ insert_theme (GtkIconTheme *icon_theme, g_key_file_load_from_file (theme_file, path, 0, &error); if (error) { + GTK_NOTE (ICONTHEME, + g_print ("Error loading %s: %s\n", path, error->message)); g_key_file_free (theme_file); theme_file = NULL; g_error_free (error); error = NULL; } + else + GTK_NOTE (ICONTHEME, g_print ("Loaded %s successfully\n", path)); } g_free (path); } @@ -1634,6 +1640,10 @@ choose_icon (GtkIconTheme *icon_th icon_info = g_object_ref (icon_info); remove_from_lru_cache (icon_theme, icon_info); + GTK_NOTE (ICONTHEME, + g_print ("choose_icon: found %s in cache\n", + g_strjoinv (",", icon_info->key.icon_names))); + return icon_info; } @@ -2813,6 +2823,10 @@ theme_lookup_icon (IconTheme *t min_difference = G_MAXINT; min_dir = NULL; + GTK_NOTE (ICONTHEME, + g_print ("theme_lookup_icon: searching theme %s for %s\n", + theme->name, icon_name)); + /* Builtin icons are logically part of the default theme and * are searched before other subdirectories of the default theme. */ @@ -2822,8 +2836,13 @@ theme_lookup_icon (IconTheme *t size, scale, &min_difference); + if (min_difference == 0) - return icon_info_new_builtin (closest_builtin); + { + GTK_NOTE (ICONTHEME, + g_print ("theme_lookup_icon found %s in builtins\n", icon_name)); + return icon_info_new_builtin (closest_builtin); + } dirs = builtin_dirs; } @@ -2836,7 +2855,7 @@ theme_lookup_icon (IconTheme *t dir = l->data; GTK_NOTE (ICONTHEME, - g_print ("theme_lookup_icon dir %s\n", dir->dir)); + g_print ("theme_lookup_icon look for %s in dir %s\n", icon_name, dir->dir)); suffix = theme_dir_get_icon_suffix (dir, icon_name, NULL); if (best_suffix (suffix, allow_svg) != ICON_SUFFIX_NONE) { @@ -2926,11 +2945,18 @@ theme_lookup_icon (IconTheme *t min_dir->subdir_index); } + GTK_NOTE (ICONTHEME, + g_print ("theme_lookup_icon found %s in dir %s\n", icon_name, min_dir->dir)); + return icon_info; } if (closest_builtin) - return icon_info_new_builtin (closest_builtin); + { + GTK_NOTE (ICONTHEME, + g_print ("theme_lookup_icon found (close to) %s in builtins\n", icon_name)); + return icon_info_new_builtin (closest_builtin); + } return NULL; }