Setting WM_CLASS of Panda3D window

I’m currently working on a game based on Panda3D and ran into a rather tiny issue, but I couldn’t find any solution to it in the forums or on IRC.

As far as I can tell, you are only able to change the WM_NAME (the window title), but not the WM_CLASS. The latter one is used by e.g. Gnome to identify the application in the task bar. With no WM_CLASS set, it will just display it as “Unknown”, which is quite annoying.

I also looked into the X11 part of the Panda3D source (1.9), but couldn’t identify any section there which would set the WM_CLASS. Thus my question is if this feature is actually missing and if so, if it will be implemented in a future release.

Hi, welcome to the forums!

This would seem to be a missing feature. What should such a value be set to? Do you think people should be able to specify a custom window class, separate from the window title?

For what it’s worth, I don’t believe Panda sets WM_NAME either. I’m not experienced with Xlib, so I don’t know how normal this is.

Well, WM_CLASS is something the user should normally be able to set himself. Gnome-Shell will first check if the WM_CLASS is defined in a .desktop file, and use that application name then, else it will use the WM_CLASS directly.

The program xprop shows good examples from running programs:

xprop | grep WM_CLASS
WM_CLASS(STRING) = "xchat", "Xchat"
xprop | grep WM_CLASS
WM_CLASS(STRING) = "Navigator", "Firefox"
xprop | grep WM_CLASS
WM_CLASS(STRING) = "Pidgin", "Pidgin"

Oh, and about WM_NAME, that one is equivalent to the window title, so it is actually (maybe indirectly) set via Panda.

All right. Could you please file this request as a bug report on the bug tracker? Thanks!

Allright, here you go:

Mh, no update so far?

Just added the x-wm-class and x-wm-class-name configuration variables in CVS. Will be available in the upcoming 1.8.1 release. Thank you for reporting this issue.

For the record, Panda does already set WM_CLASS under certain circumstances:

However, x-wm-class will override “Undecorated” when it is non-empty.