summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-25 17:26:15 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-03-25 17:26:15 -0400
commit6f8240805617c2c772c4d298dc692ac831d22013 (patch)
tree88de654c6d374da68087ded3ef80665efd0e07d4
parentbd7df4b81660924ac3d7cc7beffec6e49c1c27b7 (diff)
downloadgtk+-6f8240805617c2c772c4d298dc692ac831d22013.tar.gz
Add logging for icon fallback
Add GTK_DEBUG=iconfallback which prints out what icon names we fall back to image-missing for.
-rw-r--r--gtk/gtkdebug.h1
-rw-r--r--gtk/gtkicontheme.c5
-rw-r--r--gtk/gtkmain.c1
3 files changed, 7 insertions, 0 deletions
diff --git a/gtk/gtkdebug.h b/gtk/gtkdebug.h
index ac85014d74..4a10c96cff 100644
--- a/gtk/gtkdebug.h
+++ b/gtk/gtkdebug.h
@@ -53,6 +53,7 @@ typedef enum {
GTK_DEBUG_CONSTRAINTS = 1 << 15,
GTK_DEBUG_BUILDER_OBJECTS = 1 << 16,
GTK_DEBUG_A11Y = 1 << 17,
+ GTK_DEBUG_ICONFALLBACK = 1 << 18,
} GtkDebugFlags;
#ifdef G_ENABLE_DEBUG
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index ef1e70a0b2..7486457e17 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -2269,6 +2269,11 @@ real_choose_icon (GtkIconTheme *self,
/* Fall back to missing icon */
if (icon == NULL)
{
+ GTK_NOTE(ICONFALLBACK, {
+ char *s = g_strjoinv (", ", (char **)icon_names);
+ g_message ("No icon found for: %s", s);
+ g_free (s);
+ });
icon = icon_paintable_new ("image-missing", size, scale);
icon->filename = g_strdup (IMAGE_MISSING_RESOURCE_PATH);
icon->is_resource = TRUE;
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 02c37b045e..27dea0f007 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -197,6 +197,7 @@ static const GdkDebugKey gtk_debug_keys[] = {
{ "touchscreen", GTK_DEBUG_TOUCHSCREEN, "Pretend the pointer is a touchscreen" },
{ "snapshot", GTK_DEBUG_SNAPSHOT, "Generate debug render nodes" },
{ "accessibility", GTK_DEBUG_A11Y, "Information about accessibility state changes" },
+ { "iconfallback", GTK_DEBUG_ICONFALLBACK, "Information about icon fallback" },
};
/* This checks to see if the process is running suid or sgid