This appears to be the same question as How to add launcher icon for python script? but the solution given there doesn't seem to work for me. I have an executable tkinter script for which I have made a desktop launcher. The launcher is
[Desktop Entry] Version=1.0 Type=Application Name=Free Cell Exec=./freecell.pyw Icon=applications-cardgames Path=/home/saul/Projects/PythonProjects/freeCell Terminal=false StartupWMClass=Freecell
The call to tkinter.Tk is
self.root = root = tk.Tk(className='Freecell')
When I execute
xprop WM_CLASS and click on the window of the running app, I get
WM_CLASS(STRING) = "freecell", "Freecell"
but the icon on the window button in the panel is just a blank square. The icon shows up on the desktop fine, so that isn't the problem.
I've tried chaing the last line of the .desktop file to
StartupWMClass=freecell, as recommended in this answer, but the behavior was identical.
I'm using Xubuntu 20.04.
Part of my problem may be that I don't really understand what's going on, I'm just trying to follow the recipe. While I'll be grateful if up can tell me how to fix the problem, I'd appreciate an explanation of what's happening.