Comment 5 for bug 777417

Revision history for this message
Marco Trevisan (TreviƱo) (3v1n0) wrote :

Well, looking more in the deep, this seems more related to libSDL (that is controlled by python-pygame).

Since one of the few things _WM atom parameters that libSDL sets is the WM_CLASS, you can easily associate your application to a desktop file by setting the environment variable (also inside the python script) SDL_VIDEO_X11_WMCLASS to a value that can be the basename of your .desktop file (i.e. if you run your python script with SDL_VIDEO_X11_WMCLASS="gedit" python mygame.py it will be considered as a gedit window, so just use your_deskto_basename and it will work).

However, I'm wondering how this could be improved directly in libSDL and/or pygame to make any pygame application work out of the box. Maybe the best solution would be making pygame always to export this environment variable (set to the program's basename) when running in X11.
If there aren't best suggestions, as soon as I can I will send a patch for implementing this in pygame.