As the maintainer of Plank Reloaded, the most common bug report I get is "this app has the wrong icon." It's almost never the dock - it's a broken StartupWMClass in the app's .desktop file. So I wrote up how to find the right value on X11, Wayland, and KDE, and why deleting the line often fixes it.

top 16 comments

sorted by: hot top controversial new old
[–] 11 points 4 months ago (8 children)

I use Firefox nightly and recently switched to Wayland (KDE). Ever since I switched, the taskbar often displays Firefox nightly with the regular Firefox icon, and the name Firefox instead of Firefox nightly. After reading your blog post I'm thinking that the culprit could be an incorrect StartupWMClass. But I don't get why this issue never showed on X11 then.

  • source
  • hideshow 8 child comments
  • [–] [S] 7 points 4 months ago (7 children)

    Yeah something isn't being matched right. Might want to look at both .desktop files and compare them. Probably be pretty obvious when you look. =)

  • source
  • parent
  • hideshow 7 child comments
  • [–] 5 points 4 months ago (6 children)

    I just checked the .desktop file for firefox nightly. It contains only firefox-nightly as its StartupWMClass. So I went ahead and also checked the window class firefox nightly is running as and found the following: Screenshot showing the window properties of firefox nightly in the KDE system settings

    Does this mean that firefox nightly is using both, the firefox and the firefox-nightly window classes?

  • source
  • parent
  • hideshow 6 child comments
  • [–] [S] 1 point 4 months ago (5 children)

    Yep it has both applied. What are the actual .desktop file names?

  • source
  • parent
  • hideshow 5 child comments
  • [–] 2 points 4 months ago* (4 children)

    The desktop files are named firefox.desktop and firefox-nightly.desktop, both in /usr/share/applications.

    EDIT: For completeness, I also checked the window classes of the regular firefox: Screenshot of the KDE system settings displaying properties of the normal non-nightly firefox window

    It can be observed that it uses only the window class firefox, but twice?

  • source
  • parent
  • hideshow 4 child comments
  • [–] [S] 1 point 4 months ago (3 children)

    Yeah in your case the best fix is probably REMOVING StartupWMClass from those launchers if it is present. Then it will only match the app id on the .desktop file name.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 4 months ago (2 children)

    Hmm, but I thought the StartupWMClasses in the desktop files are correct? I thought the issue is that firefox-nightly uses the firefox class in addition to the firefox-nightly class

  • source
  • parent
  • hideshow 2 child comments
  • [+] 6 points 4 months ago (2 children)
  • [–] 2 points 4 months ago

    One thing I've noticed that's funny is that sometimes when I use waypipe to launch a remote app locally it will have a random-ass icon, like a steam game or something

  • source
  • [–] 0 points 4 months ago (1 child)
    StartupWMClass=
    

    I've never seen this line in a .desktop. What is it for?

  • source
  • hideshow 1 child comment
  • [+] -8 points 4 months ago (1 child)

    I wrote up

    I don't think you did.

  • source
  • hideshow 1 child comment
  • 2 comments in c/linux@programming.dev view that post
    [–] 4 points 4 months ago

    Oh that's interesting, I have one program that shows wrong icon but never bothered to fix it.

  • source
  • [–] 3 points 4 months ago

    Cool! I've run in to this before. Fixed it. But didn't really understand it.

  • source