flecs icon indicating copy to clipboard operation
flecs copied to clipboard

[Bug]: .desktop file name doesn't match WM Class name, causing missing app icon in Alt+Tab menu in Plasma (Wayland)

Open Damglador opened this issue 11 months ago • 8 comments

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

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

  1. Enter Wayland session (Possibly Plasma in particular, bcs AUR maintainer said on GNOME it's fine)
  2. youtube-music --ozone-platform=wayland
  3. 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

  1. Експоненційна гучність
  2. Компактна бічна панель
  3. Навігація
  4. Обхід вікових обмежень
  5. Ad blocker
  6. Discord integration

Additional Information

Continuation of #2687

Damglador avatar Dec 30 '24 03:12 Damglador

I think it's an AUR issue.

JellyBrick avatar Jan 10 '25 03:01 JellyBrick

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.

Damglador avatar Jan 10 '25 04:01 Damglador

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.

Damglador avatar Jan 10 '25 05:01 Damglador

I couldn't screenshot with alt+tab menu opened, so I had to make photos

With the default youtube-music.desktop Wayland icon on in the alt tab menu

After renaming it to com.github.th_ch.youtube_music.desktop Proper icon

Damglador avatar Jan 10 '25 05:01 Damglador

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)

h-banii avatar Jan 11 '25 01:01 h-banii

Same here (arch-x86_64, xfce, x11)

Image

Either with AUR or with AppImage.

sigmanor avatar Jan 22 '25 10:01 sigmanor

Changing the desktop file name from youtube-music to com.github.th_ch.youtube_music fixed that problem on NixOS for me.

SuperSandro2000 avatar Apr 18 '25 16:04 SuperSandro2000

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
Image Image
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.

h-banii avatar Apr 20 '25 07:04 h-banii