GNOME Bugzilla – Bug 89245
.xpm icon gets selected even when .png is specified in .desktop file
Last modified: 2004-12-22 21:47:04 UTC
It seems that gnome-panel selects .xpm files even when the corresponding png is specified in the .desktop file. i.e., the file gedit-icon.xpm is selected over gedit-icon.png. This may have to do with the Debian menu system, which needs to use xpm files for icons. For example, the gedit entry in the normal GNOME menus should display the PNG file (as specified in the .desktop file), and the gedit entry in the debian menu should display the .xpm file. Maybe this is some sort of collison between filenames internally in gnome-panel?
In CVS gnome-panel, icons are looked up according to the icon theme specification from www.freedesktop.org. See GnomeIconLoader in libgnome-desktop. Essentially, we ignore the suffix in the .desktop file and look for an icon in the following order: .png, .svg and then .xpm. It looks to me like the system you are using must have a patch to always favour .xpm. Marking as NOTGNOME, but re-open if I'm wrong.
Hi, This doesn't work. I did the following : cd /usr/share/pixmaps convert gnome-gnumeric.png gnome-gnumeric.xpm cp gnome-folder.png gnome-gnumeric.png To be sure pkill gnome-panel The gnumeric entry still display the gnumeric icon. rm gnome-gnumeric.xpm pkill gnome-panel Now I've the folder icon.
Okay, I was wrong about it using the Icon Theme specification - I had a assumed that the icons in $(prefix)/share/pixmaps were part of the 'default' theme, but that's not the case. So icons are only looked up according to the icon theme spec, if you have an icon theme insalled. It falls back on the old code of looking up the icon (using its extension) in $(prefix)/share/pixmaps ... I've tried out what you said, and it always picks up the .png instead of the .xpm ... I'm resolving as NOTGNOME again, since you still haven't told me whether you are using a Debian specific patch or not. I suspect you are ...
Hi, I patch nothing, and I don't see a good reason to patch gnome-desktop. Read the diff : http://ftp.debian.org/debian/pool/main/g/gnome-desktop/gnome-desktop_2.0.3-1.diff.gz This is still a bug.
Clarification: Christian Marillat is the gnome-panel and gnome-desktop maintainer for Debian.
Christian: okay, I had to make sure that the bug was in CVS and not a debian patch .... So ... I can't reproduce this and have no idea what might be causing it ... Christian: could you debug this and figure out what gnome_desktop_item_find_icon is doing. Is it picking up the the .xpm in gnome_icon_loader_lookup_icon or is it finding it in the 'old GNOME/KDE code' ? thanks.
I did the following with test-icon-theme ./test-icon-theme lookup default gtm Continuing. icon for gtm at 48x48 is /usr/share/pixmaps/gtm.xpm Of course I've two icons in png and xpm formats. But the png image size is 48x48 and the xpm is 32x32 Then I've put a breakpoint in gnome-desktop-item.c line 2148 in gnome_desktop_item_find_icon(), but this breackpoint has never been reached. What's wrong ?
Okay, I'm utterly confused. I can't reproduce this with test-icon-theme. Alex: could you take a look a this ?
Christian: I think I came across the issue while fixing something else .. This should fix it - re-open if not 2002-08-06 Mark McLoughlin <mark@skynet.ie> * Makefile.am: define pixmaps and icons dir. * gnome-icon-loader.c: (remove_gconf_handler): remove unused variables. (gnome_icon_loader_init): add pixmaps and icons dir for the prefix we are installed into. (load_themes): don't stat the icons, we don't do that for themed icons anyway. Actually check which format we are favouring, should fix #89245. (suffix_from_name): impl. (scan_directory): use it here.
Yes this is fixed in CVS. Thanks.