Recently GNOME 3.10 was pushed to the Arch Linux repos. I don't really care about GNOME as I don't use it, but with a GNOME release usually also come new versions of a few independent components such as GLib or GTK+.
Unfortunately, it seems GNOME developers have no problem trying to force their decisions not only to their users, but also users of any application using GTK+ regardless of their DE.
Specifically, this upgrade wasn't easy (to me) when it comes to icons. After the upgrade, I had quite a few icons broken, and lots of buttons & menus where icons were simply missing altogether.
Broken icons: what's with symbolic icons anyways?
The first issue was linked to symbolic icons. In addition to the "regular" icons, provided by whatever theme you have installed, GNOME (and GTK) also uses those so-called symbolic icons, for some reason.
This isn't another icon theme that one can chose to use or not. Those icons are "part" of the main theme, complementing it somehow. And in quite a few places, instead of asking for an icon, e.g. "dialog-error" when showing an error message, GTK will ask for the symbolic version ("dialog-error-symbolic").
Until now, when such icon couldn't be found, it would fall back to the non-symbolic version. However, the algorithm was buggy, as it could send "foo-bar" when "foo-bar-symbolic" wasn't found, even though "foo-symbolic" existed (and therefore should have been returned); See this bug report for more.
And when that got fixed, they decided to never fall back to non-symbolic icons. If no symbolic icon is found, then it's the missing icon that will be used. Which is a problem for me, because, of course, I don't have any of those.
I'm not sure what's the point of such icons is, but as far as I'm concerned they just replaced my perfectly fine looking icons from the icon theme I selected, with ugly flat icons I didn't like at all. So I removed them, plain & simple.
Adding a fallback to non-symbolic icons
Once this was established, I decided to simply add a fallback to the "regular" icons in the algorithm, as originally suggested in the bug report. For this to work, it had to be done twice: once in GLib (re: GThemedIcon), and once in GTK (re: GtkIconTheme).
Here are the patches I used:
- diff --git a/gio/gthemedicon.c b/gio/gthemedicon.c
- index 9016860..e7a59f8 100644
- --- a/gio/gthemedicon.c
- +++ b/gio/gthemedicon.c
- @@ -187,12 +187,12 @@ g_themed_icon_constructed (GObject *object)
- if (is_symbolic)
- - themed->names = g_new (char *, dashes + 1 + 1);
- + themed->names = g_new (char *, 2 * (dashes + 1) + 1);
- for (i = 0; names[i] != NULL; i++)
- themed->names[i] = g_strconcat (names[i], "-symbolic", NULL);
- - themed->names[i] = NULL;
- - g_strfreev (names);
- + memcpy (themed->names + i, names, sizeof (char *) * (dashes + 1 + 1));
- + g_free (names);
- diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
- index d912687..1a225a2 100644
- --- a/gtk/gtkicontheme.c
- +++ b/gtk/gtkicontheme.c
- @@ -1897,12 +1897,12 @@ gtk_icon_theme_lookup_icon_for_scale (GtkIconTheme *icon_theme,
- if (is_symbolic)
- - names = g_new (gchar *, dashes + 2);
- + names = g_new (gchar *, 2 * (dashes + 1) + 1);
- for (i = 0; nonsymbolic_names[i] != NULL; i++)
- names[i] = g_strconcat (nonsymbolic_names[i], "-symbolic", NULL);
- - names[i] = NULL;
- - g_strfreev (nonsymbolic_names);
- + memcpy (names + i, nonsymbolic_names, sizeof (gchar *) * (dashes + 2));
- + g_free (nonsymbolic_names);
No more icons on buttons & in menus
This one was also a deliberate change, though while I'll give you that maybe not having symbolic icons isn't the "proper"/usual way of doing things, this time I don't have a special setup at all.
What happened is that apparently the GNOME folks decided they don't want to have any icons in their buttons or menus anymore. I'm not sure why, since it's a great help as everyone can see how using icons helps you recognize what you're looking for much easier/faster.
I'm also not sure if forcing their choices onto their users is a good move, I thought the whole idea of a GNU/Linux system was to put the user in control. But where things go seriously wrong is when they force their changes to every GTK users, or users/developers of GTK applications.
Which is what happened, what they deprecated options
gtk-menu-images in 3.10, meaning that those settings are now ignored, and
users have no choice in the matter anymore.
They'll tell you developers can still put icons in their menus/buttons if they want to, but (a) that means patching every single GTK application to fix what GTK 3.10 broke, and (b) that's doing nothing for users. What badly broke here is the user experience of anyone using a GTK application that had icons in menus and/or buttons (and that's a lot of them).
This is an issue they were fully aware of -- see this bug report -- but apparently that didn't bother them much.
So I'm not sure how best to handle this eventually, but for now what I did was simply revert the two commits that removed support of said options. Specifically, I reverted commits 65c31629 and e8147d15.
And with all that, I finally have my system working as it should, with all icons showing properly (including in buttons & menus, because I want/need that), with GTK 3.10 installed.