How to fix generic Wayland icon in taskbar for "foreign" apps (Firefox Dev edition)

So this is already a well-known issue (discuss.kde org/t/bug-generic-wayland-icon-for-many-applications/2468/6), but I don’t know about the current state of fixing.

  • I run Fedora 40, Wayland, Plasma 6.

I installed Firefox developer edition (mozilla org/de/firefox/developer) alongside the regular Firefox - for non-.deb distros it’s just a tar ball to download and run from anywhere, i.e. it’s not handled by the package manager (which is what I mean by “foreign” apps in the title).
Its icon a) in the taskbar when running and b) in Overview is a generic Wayland icon, and it’s not recognized (mapped?) as an app whose icon is pinned:
Screenshot_20240517_005345

Firefox is installed to ~/Apps/Firefox-DevEd, and its .desktop file is in ~/.local/share/applications where I renamed it to org.mozilla.firefox-developer.desktop to see if this fix (nicolasfella de/ posts/fixing-wayland-taskbar-icons/) would work, but no luck.

Anyway I suppose it should work for normal apps installed by the package manager to some root location, but not the aforementioned “foreign” apps?
Because the regular Firefox (Fedora default browser, handled by package manager) has the icon showing and behaving properly.

Is there a way I can fix this, short of the bug getting actually fixed by the devs?

See Fixing Wayland taskbar icons - Nico’s blog.

That does not actually fix it for me. The workaround I tried is of course taken from that blog, as I already mentioned:

But I found one that does work in Nick’s TLE video:
youtube com/watch?v=Sungl8gWU_8&t=129s

The only problem here is, the first step says to right-click the title bar, but if your app doesn’t have a title bar like for instance Firefox, you need to go directly to the window rules:
Settings > Apps&Windows > Window Management > Window Rules

You need to match the app window class to create a new window rule as described later in the video:
youtube com/watch?v=Sungl8gWU_8&t=268s

and then you can proceed as described in the video, even if without adding the title bar first.

I thought the fix would work differently if the app is not installed by package manager, but it’s the same. You just need to know the correct name and location of the desktop file, and match that in the window rules.