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

Open
opened 2024-12-30 03:53:49 +00:00 by Damglador · 8 comments
Damglador commented 2024-12-30 03:53:49 +00:00 (Migrated from github.com)

Preflight Checklist

  • I use the latest version of YouTube Music (Application).
  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.
  • 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

### Preflight Checklist - [X] I use the latest version of YouTube Music (Application). - [X] I have searched the [issue tracker](https://github.com/th-ch/youtube-music/issues) 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](https://music.youtube.com). ### 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
JellyBrick commented 2025-01-10 03:01:42 +00:00 (Migrated from github.com)

I think it's an AUR issue.

I think it's an AUR issue.
Damglador commented 2025-01-10 04:03:11 +00:00 (Migrated from github.com)

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 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 commented 2025-01-10 05:12:09 +00:00 (Migrated from github.com)

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 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 commented 2025-01-10 05:21:15 +00:00 (Migrated from github.com)

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

I couldn't screenshot with alt+tab menu opened, so I had to make photos With the default `youtube-music.desktop` <img src="https://github.com/user-attachments/assets/def3f029-2041-4644-9554-45db628b075e" alt="Wayland icon on in the alt tab menu" width="216" height="whatever"> After renaming it to `com.github.th_ch.youtube_music.desktop` <img src="https://github.com/user-attachments/assets/ddee3729-c670-4a93-b3b7-06c01421ac65" alt="Proper icon" width="216" height="whatever">
h-banii commented 2025-01-11 01:05:22 +00:00 (Migrated from github.com)

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)

The .desktop file included in the AppImage is also named `youtube-music.desktop`, so I think it's something to do with electron-builder. <hr> 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)
Sigmanor commented 2025-01-22 10:02:02 +00:00 (Migrated from github.com)

Same here (arch-x86_64, xfce, x11)

Image

Either with AUR or with AppImage.

Same here (arch-x86_64, xfce, x11) ![Image](https://github.com/user-attachments/assets/59f547c1-3edb-477c-9954-a56525a4b8a9) Either with AUR or with AppImage.
SuperSandro2000 commented 2025-04-18 16:48:19 +00:00 (Migrated from github.com)

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

Changing the desktop file name from youtube-music to com.github.th_ch.youtube_music fixed that problem on NixOS for me.
h-banii commented 2025-04-20 07:11:07 +00:00 (Migrated from github.com)

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:
d513302a9a/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.

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 <hr> Last time I only tested gnome and kde, so here's xfce in a VM |youtube-music.desktop|{wmclass}.desktop| |-|-| |![Image](https://github.com/user-attachments/assets/f7803936-6c8a-42c3-901a-70f326ae6f58)|![Image](https://github.com/user-attachments/assets/68f785bc-e60c-4fd6-80e8-677fc4ea0f71)| |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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: YTMD/youtube-music#2806
No description provided.