Is icon window property supported on Linux?

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.

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

Done here

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.

This is how I’m solved it -

I’m just included icon and rebuild Panda3D xD

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

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

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