Is icon window property supported on Linux?


#1

I’m trying to use PRC property ‘icon-filename’ or WindowProperties.setIconFilename() to set the icon of my application window, but does not seem to work at all on Linux/X11, though it works fine on MacOS.

Grepping the Panda source code, I can’t find any reference to icon configuration code in the X11 display code; on the other hand, osx and win display codes are using the icon_filename property.


#2

It’s not. Please file an issue on GitHub for this shortcoming (after verifying that no such issue already exists).


#3

Done here https://github.com/panda3d/panda3d/issues/603

I can help fixing it, but my knowledge of PNMImage is rather limited so don’t know yet how to read the icon file and extract the icon bitmap with the right format.


#4

This is how I’m solved it - https://github.com/Yonnji/KITSUNETSUKI-SDK/blob/master/conda/panda3d/icon.patch

I’m just included icon and rebuild Panda3D xD


#5

PNMImage doesn’t support reading a specific icon image, I think, but the X11 code does already have some code for loading .ico files.


#6

I have made a PR to add the feature, it seems to work fine on my setup but if people with other WM could test if it works for them too it would be great :slight_smile:

For Ubuntu Unity it won’t work however as, according to several source, it uses a non-standard way to configure the application icon…

@Yonnji, Eventually I took your approach to send the icon to the WM, the pixmap in wm_hints has too many limitations.

Edit: here is the link to the PR https://github.com/panda3d/panda3d/pull/614


#7

Nice, thanks! I will test it later. I have to rebuild the engine again >_<