mojira.dev
MCL-24384

No icon for game window under Linux

The .desktop file included with the Minecraft Launcher on the AUR does not set StartupWMClass to any value, which causes any instances of the game launched to utilise the default icon for a Java executable, rather than the system's Minecraft icon.

The StartupWMClass variable in the desktop file should be set to the same value as the WM_Class of the game window, which can be found by using the xprop command on the game window, which returns the following value for WM_CLASS(STRING): 

WM_CLASS(STRING) = "Minecraft 1.21", "Minecraft 1.21"

By adding this to the desktop file as follows (added text in green), the game window will be correctly grouped with the launcher and utilise the correct icon.

[Desktop Entry]
Type=Application
Version=1.0
Name=Minecraft Launcher
GenericName=Minecraft Launcher
Comment=Official Minecraft Launcher
Exec=minecraft-launcher
Icon=minecraft-launcher
Terminal=false
Categories=Game;Application;
StartupNotify=true
StartupWMClass=Minecraft 1.21

However, as the WM_Class is currently different for every version of the game, this solution is infeasible for the long run, and the WM_Class of any game instance initiated by the launcher should be set to a constant value, such as "Minecraft".

Comments 1

Hi!

Can you share a video/screenshot of this issue?
Can you also upload a launcher_log file from your minecraft folder?

This ticket will automatically reopen when you reply.

sicarious

(Unassigned)

Unconfirmed

Retrieved