Closed Botspot closed 1 month ago
- Do nothing and still claim it is not worth fixing. I would hope that you choose not to do this.
I'm afraid that is exactly what I am going to do. As far as I can tell, the use of an explicit icon file name without a path is not supported by the FreeDesktop spec, so these applications do not conform to it - I suspect most of them are rather old and unmaintained. I also suspect that on various other distros, they would also get no icon loading, because the handling of anything other than a fully-specified path is down to the implementation, and any fix for this is going to involve an ugly hack which is not supported by the spec.
Most people will never install any of these applications on Pi (or, by the look of most of them, any other distro...) so I feel that this very much is an edge case that will affect a very small number of icons on the system for a very small number of users. If that turns out not to be the case in reality, I can revisit this, but for now, we will be following the FreeDesktop spec and supporting full paths and icon lookup in the theme only.
On reading the FreeDesktop spec again, it seems that installing icon files in /usr/share/pixmaps is (or at least used to be) legitimate, and in the case of Netsurf, that is the only place it puts an icon file anyway.
So I am going to add a fallback option so that if an explicit path is not specified and the named icon is not found in the theme, then I will look for that named icon in /usr/share/pixmaps. I suspect this will fix the vast majority of the cases above, which look like old and unmaintained apps which may have used this earlier location for icon installation.
This issue is based on the previous issue here: https://github.com/raspberrypi-ui/wf-panel-pi/issues/21
While the detection of explicit icons paths was restored in commit https://github.com/raspberrypi-ui/wf-panel-pi/commit/d7694198be1ee77dcac8b0373771c43decc221af, the menu will still fail to detect a suitable icon for .desktop files that specify an explicit filename without a full path.
This may seem like an edge case. The functionality is not guaranteed in the Freedesktop spec, and I agree with you that it seems like an ugly hack. In fact I only even noticed it thanks to Netsurf web browser. To check if this was unique to Netsurf or if it affected other applications, I wrote a script to download every apt package containing a .desktop file and check for the presence of this specific icon reference style. Here is the script.
This was the output.
It found 140 affected packages out of the 2791 total packages that have a menu launcher, meaning that this update to the menu breaks the icon for about 5% of all GUI applications, or 1 in 20.
This is far more significant than I had expected. I had predicted the number of affected apps would be well under 1%.
With these findings in mind, I can think of a few solutions: