Wrong Active Application Icon showing in Gnome Dock after launching Visual Studio Code

I noticed the wrong active Application Icon is showing in the Gnome Dock for Visual Studio Code even though the correct desktop\launch Icon is correct.

The Desktop\Launch Icon:

Screenshot from 2021-08-31 13-14-47

Screenshot from 2021-08-31 12-53-59

The Active Application Icon after Visual Studio Code uses the Katalon icon (icon.xpm) which is located in the “~/Development/Katalon_Studio_Linux_64” Directory:

image

The Gnome Dash with Visual Studio launched:

image

When I look at the .desktop files:

Visual Studio Desktop File ( /usr/share/applications/visual-studio-code.desktop)

[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Refined.
GenericName=Text Editor
Exec=/opt/visual-studio-code/code --no-sandbox --unity-launch %F
Icon=visual-studio-code
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;application/x-visual-studio-code-workspace;
Actions=new-empty-window;
Keywords=vscode;

[Desktop Action new-empty-window]
Name=New Empty Window
Exec=/opt/visual-studio-code/code --no-sandbox --new-window %F
Icon=visual-studio-code

Katalon Desktop file (.local/share/applications/Katalon_Studio.desktop)

[Desktop Entry]
Version=1.0
Type=Application
Name=Katalon Studio
Icon=/home/rsruser/Development/Katalon_Studio_Linux_64/icon.xpm
Exec="/home/rsruser/Development/Katalon_Studio_Linux_64/katalon" %f
Comment=Automation platform based on Selenium
Categories=Development;
Terminal=false
MimeType=text/plain;inode/directory;
StartupNotify=true
StartupWMClass=code

So in summary I am looking for help on why the wrong Active Application Icon is showing in the Gnome Dash after the application launches?

One big difference- The Katalon launcher specifically calls out the icon file to use while the VSCode launcher uses an icon named “visual-studio-code” which is expected to exist as part of the current icon theme.

I’m wondering if there is a “visual-studio-code” icon in the current icon theme and if this behavior persists if another icon theme is used.

This is a good question. My assumption here originally is if the desktop icon is correct then the theme has an icon. But for kicks I can also use Icon Browser in Gnome:

image

Whats interesting is if I rename the directory “~/Development/Katalon_Studio_Linux_64” to “~/Development/Katalon_Studio_Linux_64_org” then the correct Visual Studio Active Icon will show after I reboot the system. Keep in mind the correct Desktop Icon always shows correctly.

So when an application launches, where is it sourcing the icon from?