How does the gnome shell know which icon/entry to use in the dash for wayland apps started from the commandline?
It it still the WM_CLASS X property? How to set this for Wayland apps?
Is it using .desktop files? If so, what is the key to the find the correct one?
the concrete hickup i have is that i start my self compiled emacs (using pgtk) emacs in daemon mode as an autostart program with ‘–daemon --name=emacs-pgtkj’.
I also created a ~/.local/share/applications/desktop file with a call to emacsclient so that the background emacs is used. This desktop file contains the name of my own emacs-pgtk.svg file as an icon and StartupWMClass ‘emacs-pgtk’.
I would expect that all new windows (frames) opened by emacslciient appear with the emacs-pgtk file as their icon.
But, whenever i click on the dash entry for this emacsclient program, the stock emacs icon is used.
I also tested it with a call to my pgtk emacs in the ~/.local/share/applications/emacs.desktop file, not using emacsclient and then it works. the emacs-pgtk icon is used in the dash.
Wayland has no window icons, so the shell has to match the window to a .desktop file. StartupWMClass= works, but what it matches on is the Wayland XDG Shell app_id. You can see that in the Windows tab in Looking Glass (Alt+F2 → lg) as wmclass. Normally, you would name the .desktop file to match the app ID, which does the same thing.
That was the missing piece of information. Since emacs does not call g_set_prgname it uses the executable name to match against .desktop files.
Simply linking the emacs executable to emacspgtk and defining a emacspgtk.desktop file did the trick.