Replace icon.xpm with icon.png, please
On a freshly installed Fedora Linux 41 with Gnome running as the UI, I have created a .desktop file, which references the icon.xpm, like so:
Icon=/home/jwi/opt/eclipse/icon.xpm
Now, I can launch Eclipse from my desktop, as expected. However, there is one problem: The icon is not showing. This appears to be intentional (no idea, whether it is the Gnome teams intention, or the Fedora teams), so I assume, that this will be the same in future releases of Fedora. It is also quite possible, that other distributions will adopt the same behaviour. (As you know, Fedora is the leading edge in terms of Gnome.
I have found two different workarounds:
- According to Bug 2277502, the issue can be fixed by installing an additional RPM package gdk-pixbuf2-modules-extra:
sudo dnf -y install gdk-pixbuf2-modules-extra
2.) A more obvious solution, and one, that the Eclipse platform team could help with: Convert the xpm file to png. Indeed, if I do that, and change my .desktop file to use the converted png file, then everything works fine.
In other words: It might be a good idea, to add a new file icon.png to the Eclipse distribution. No idea, whether this could replace icon.xpm, or whether the latter is still required elsewhere.
Thanks,
Jochen
Would you be interested in contributing a Pull Request replacing the xpm with the png?
Please note that this is deeply integrated into Eclipse Build tools, also the xpm contains several resolutions of the icon while PNG can only ever contain one. Under windows we have different configurable sizes and replace them in the executable but for linux I'm not aware of such thing. Maybe SVG can be used, at laest that is what I see for native apps when I select an icon that SVG is possible.
Also one would need to adjust the UI (currently one cal only select xmp for linux) in the product editor.
Please note that this is deeply integrated into Eclipse Build tools,
I don't think xpm is per se required for the build.
he xpm contains several resolutions of the icon while PNG can only ever contain one.
if we put in the png with highest resolution that's available from xpm, then it would be better than the current state on Linux anyway.
Under windows we have different configurable sizes and replace them in the executable but for linux I'm not aware of such thing
The .product format does allow different icon for windows and linux. We could just add and set the png for linux then, and keep the xpm anyway.
If I press browse it explicitly only allows to select an XPM resource:
If you look here you can see that only xpm is allowed/supported as well:
https://github.com/eclipse-equinox/p2/blob/a4ef0e13d527c84b3cc48bda344b5918824dc84f/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/BrandingIron.java#L158-L176
so while technically one can place a png icon somewhere next to the launcher, but this does not mean it will work in any way out of the box without adjustment to the build and tools and is "simply" replaceable.
Also as mentioned, PNG is a bad choice, SVG should be the way to go if one wants to change this here.
If you look here you can see that only xpm is allowed/supported as well: https://github.com/eclipse-equinox/p2/blob/a4ef0e13d527c84b3cc48bda344b5918824dc84f/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/BrandingIron.java#L158-L176
Thanks for the link. PNG cannot work without a fix there then. @jochenw would you be interested in trying to improve this piece of code to allow other formats?