I can add that for me the only thing that worked was adding StartupWMClass AND renaming the .desktop file of the game to match the name of the "unknown" icon in the Dash on GNOME 49.2.
For example starting Overwatch 2 on Steam launched "overwatch.exe" and showed "overwatch.exe" in the Dash with the standard "unknown" icon. Renaming my .desktop file from "Overwatch 2.desktop" to "overwatch.exe.desktop" solved the issue for me.
So, adding "StartupWMClass=steam_app_2357570" (appid for Overwatch 2) to the end of the .desktop file did not work.
Adding "StartupWMClass=steam_app_2357570" AND renaming the file to "overwatch.exe.desktop" solved the issue for me.
DE: GNOME 49.2
My system information:
Adding "StartupWMClass=steam_app_2357570" AND renaming the file to "overwatch.exe.desktop" solved the issue for me.
Just to clarify, you should only need to do one or the other depending on the window name given to the launched application. That is, you can also just do StartupWMClass=overwatch.exe without having to also rename the file. In my case, Steam launches Overwatch 2 with a window named "steam_app_2357570" so that's why StartupWMClass=steam_app_2357570 worked for me.
GNOME uses both the name of the desktop entry file and StartupWMClass when determining if a window belongs to an application defined by a desktop entry, but it only needs one of them to match.
On a tangential note: I wonder why Steam sometimes uses the app ID and sometimes uses the executable file name for window names? The first time I noticed that with another game, I assumed maybe it had to do with the game running natively, but Overwatch certainly isn't native.
Nothing extracted yet.
Your system information
Please describe your issue in as much detail as possible:
When installing a game via Steam, a new desktop entry (
.desktopfile) gets created in~/.local/share/applicationsthat is named the same as the game that was just installed. However, when running a game via Steam the window appears to be named using the app's Steam ID, i.e.steam_app_<game_id>. This causes the game's window icon in the Gnome dock to show the generic gear icon.The desktop entry is configured correctly to show the game's icon as this is how it shows up in Gnome's "Show Apps" view:
For ZeroRanger, the
.desktopfile is namedZeroRanger.desktopand the contents of the desktop entry are as follows:When the game is running, it's window shows up in the Gnome dock like this:
As a workaround, you can either:
Add the
StartupWMClass=steam_app_<app_id>property to the end of the.desktopfile (for ZeroRanger it would beStartupWMClass=steam_app_809020).Rename the
.desktopfile itself to match the name of the window (for ZeroRanger it becomessteam_app_809020.desktop).Either of these then cause the window to show the correct icon/name in the dock.
Hopefully there's a way for Steam to handle this itself when creating the desktop icons.
Steps for reproducing this issue: