Missing GTK 4 icons (with fix)

I have run into yet another issue with GTK icons showing up as grayed out warning triangles instead of the actual icons. This time, it affected GTK 4 applications only.

The following did not help in this case, though they may help with other instances of missing icons in other situations:

  • sudo pacman -S adwaita-icon-theme (reinstalling adwaita-icon-theme)
  • sudo gdk-pixbuf-query-loaders --update-cache
  • ln -s ../gtk-3.0/settings.ini ~/.config/gtk-4.0/

So I did an strace and found out it was searching for icons in the Papirus-Dark-Maia theme, which was not installed, instead of the usual default Adwaita theme.

Now I could have:

  • just installed that theme, but a dark icon theme is not going to fit well in the light Plasma Mobile theme,
  • just symlinked Adwaita to Papirus-Dark-Maia, but ewww.

So what is the proper fix then?

The following is the proper fix:

gsettings set org.gnome.desktop.interface icon-theme Adwaita

(Run this as your user, not as root/sudo.)

Note that I tried setting the theme to Breeze, but that does not seem to provide the needed icons (and as mentioned above, the theme set here is looked up by GTK instead of Adwaita), so Adwaita it is.

I hope this helps.

Can we maybe get the Plasma Mobile images set up this way by default? Papirus-Dark-Maia may make sense as a default on Phosh, not so much on Plasma Mobile.

Breeze might just not have the icons for that application?

But if it does need to be set, we need to find a way to do it with a .override file, like this one.

I think the underlying issue is that those gtk4+libadwaita applications are using icons that are only available in the Adwaita theme (and possibly some other GNOME themes), but the hardcoded fallback in gtk4 is still the legacy gnome icon theme that does not contain the icons.

So, if either

  • the theme is set to a non-existent/non-installed theme (such as Papirus-Dark-Maia), or
  • the theme is set to a non-GNOME theme like Breeze that also does not contain those icons

then the icon will not be found, because neither the selected theme nor the fallback theme has the icon.

There used to be a settings.ini setting to set a fallback theme, but unfortunately support for that setting was dropped in GTK 3.10 (and GTK 4 does not even know that option at all anymore). Supposedly, the theme should be giving its own fallbacks, but a KDE theme is not going to have Adwaita set as the fallback, so that is a very broken assumption. And unfortunately, the hardcoded fallback is no longer adequate either.

So we actually have 2 issues in Plasma Mobile:

  • There is nothing setting the GTK 4 theme to a theme that exists. At least on my account, there exists a ~/.config/gtk-3.0/settings.ini, but no ~/.config/gtk-4.0/settings.ini (which is why I tried symlinking the GTK 3 one into the GTK 4 folder, but that did not help either, presumably due to the other issue). So we inherit the setting to Papirus-Dark-Maia, which is not installed, from some systemwide configuration.
  • When setting the GTK 4 theme to Breeze, the applications do not find some icons because they are contained neither in Breeze nor in the fallback gnome theme (only in Adwaita).

I would say the first issue is an issue with the Plasma Mobile edition, the second issue is an upstream GTK/GNOME/application issue.

We don’t set Papirus anywhere. Our gtk3 (the only one we have set in Plasma Mobile) set Breeze as icon theme and Adwaita as fallback icon theme.
We don’t have such a settings for gtk4, but I’ll gladly add it, if you can find a way to add it via a config file.

Well, I have no idea where the setting comes from, but it was definitely set somewhere, because gsettings get org.gnome.desktop.interface icon-theme returned it and because it showed up in the strace.

Our gtk3 (the only one we have set in Plasma Mobile) set Breeze as icon theme and Adwaita as fallback icon theme.

Unfortunately, the gtk-fallback-icon-theme setting is completely ignored by current GTK 3.

We don’t have such a settings for gtk4, but I’ll gladly add it, if you can find a way to add it via a config file.

I do not think we can do that, at least not without patching GTK. We can only set one theme, so apparently we get to choose between a consistent look with some missing icons (Breeze) and a look inconsistent with the rest of the system, but with hopefully no missing icons (Adwaita). But at least the setting should point to an icon theme that is actually installed, not to Papirus-Dark-Maia.

Affected applications I have run into so far: GNOME Secrets uses at least 1 Adwaita-only icon, GNOME Chess at least 3 of them.

I really have to wonder what we have an icon-naming-spec for if GNOME then happily invents new icons and does not even provide them in the hardcoded fallback theme (the gnome-icon-theme).

As far as I can tell (also confirmed using strace), the GTK 4 applications ignore even the gtk-icon-theme setting in ~/.config/gtk-4.0/settings.ini. If I set that to breeze (as in the GTK 3 settings.ini), that does exactly nothing. The gsettings setting is used instead.

Yes. So it seems an override is needed.