GNOME Bugzilla – Bug 733998
Icons aren't properly loaded under Ubuntu
Last modified: 2014-07-31 15:00:57 UTC
In Ubuntu, when launching GNOME Software, we get failures to load app icons, e.g.: (org.gnome.Software:31009): GsPlugin-WARNING **: failed to load cached icon xchat: Failed to open file '/usr/share/app-install/icons/xchat': No such file or directory This makes every app invalid, leading to: (org.gnome.Software:31009): Gs-WARNING **: failed to get featured apps: no featured apps to show The cause is that the Icon field in the .desktop files omits the file extension (e.g. xchat vs xchat.svg). Appending this to the icon directory isn't sufficient (e.g. /usr/share/app-install/icons/xchat, while the file is at /usr/share/app-install/icons/xchat.svg). We actually have to load it as an actual icon from an icon theme with the correct theme search path.
Created attachment 282095 [details] [review] Add icon directory to theme search path
Created attachment 282129 [details] [review] Add icon directory to theme search path org.gnome.Weather.Application is an icon name with full stop characters in it. So we need to modify gs_pixbuf_load () to accept it as an icon name too.
Where does the metadata on Ubuntu come from? Do you know why it has 'xchat' instead of 'xchat.png' in the metadata?
The meta-data comes from a package called app-install-data. Here's an example .desktop: [Desktop Entry] X-AppInstall-Package=xchat X-AppInstall-Popcon=1348 X-AppInstall-Section=universe Encoding=UTF-8 Name=XChat IRC Comment=Chat with other people using Internet Relay Chat Exec=sh -c "xchat --existing --url %U || exec xchat" Icon=xchat Terminal=false Type=Application Categories=Network; StartupNotify=true MimeType=x-scheme-handler/irc;x-scheme-handler/ircs; X-Ubuntu-Gettext-Domain=app-install-data It seems like the icon in the .desktop file is only a name, and the icons directory is meant to be treated as a GtkIconTheme directory.
Patch looks good, thanks. I had to fix it up to not fail to load icons with AppStream metadata-style names, and I also made some of the new icon theme stuf match the AppStream name for clarity.