[Bug]: .desktop file name doesn't match WM Class name, causing missing app icon in Alt+Tab menu in Plasma (Wayland)
Preflight Checklist
- [X] I use the latest version of YouTube Music (Application).
- [X] I have searched the issue tracker for a bug report that matches the one I want to file, without success.
- [X] I understand that th-ch/youtube-music has NO affiliation with Google or YouTube
YouTube Music (Application) Version
3.7.1
Checklists
- [ ] I use the portable version of the YouTube Music Application.
- [ ] I can reproduce this issue in the official version of (WEB) YTM.
What operating system are you using?
Other Linux
Operating System Version
Arch Linux
What CPU architecture are you using?
x64
Last Known Working YouTube Music (Application) version
No response
Reproduction steps
- Enter Wayland session (Possibly Plasma in particular, bcs AUR maintainer said on GNOME it's fine)
- youtube-music --ozone-platform=wayland
- In alt+tab menu app will have a stock Wayland icon
Expected Behavior
App should have it's icon in alt+tab menu
Actual Behavior
It has Wayland icon
Enabled plugins
- Експоненційна гучність
- Компактна бічна панель
- Навігація
- Обхід вікових обмежень
- Ad blocker
- Discord integration
Additional Information
Continuation of #2687
I think it's an AUR issue.
I think it's an AUR issue.
Yes. But when I asked there, the maintainer said that the official .deb package has the same thing.
I also checked youtube-music_3.7.1_arm64.deb from releases, just to be sure, and the .desktop file there indeed has a "wrong" name. The name in the .deb is youtube-music.desktop, so is in the AUR packages, but unless it matches the WMClass nane the icon will be missing, at least on KDE Plasma. The AUR maintainer said the icon is there for them on GNOME after only changing StartupWMClass.
I couldn't screenshot with alt+tab menu opened, so I had to make photos
With the default youtube-music.desktop
After renaming it to com.github.th_ch.youtube_music.desktop
The .desktop file included in the AppImage is also named youtube-music.desktop, so I think it's something to do with electron-builder.
I've tested both GNOME and Plasma in a NixOS VM and it seems that:
| no change | change .desktop file name to match the WM Class | |
|---|---|---|
| GNOME | all icons seems to be right | icon in MPRIS widget is wrong |
| Plasma | icon in the task bar is right, but it's wrong in the alt+tab menu and window decoration | all icons seems to be right |
(I got the same results on both wayland and x11)
Same here (arch-x86_64, xfce, x11)
Either with AUR or with AppImage.
Changing the desktop file name from youtube-music to com.github.th_ch.youtube_music fixed that problem on NixOS for me.
Yes, but it breaks gnome (as I mentioned a few months ago), and I just figured out why.
The problem is that the DesktopEntry property in MPRIS's MediaPlayer2 interface should be updated to match the desktop entry basename.
So if we ever decide to change the name of the desktop entry file, we gotta remember to update this line as well: https://github.com/th-ch/youtube-music/blob/d513302a9a34a1f221f95e8ce45ae4b61d44fe15/src/plugins/shortcuts/mpris.ts#L82
As specified here https://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html#Property:DesktopEntry
Last time I only tested gnome and kde, so here's xfce in a VM
| youtube-music.desktop | {wmclass}.desktop |
|---|---|
| all icons are wrong, except systray | taskbar icon gets fixed, but alt-menu is still wrong... |
I don't know if xfce has a default MPRIS widget, if so I didn't check it.