Why do so many Linux apps ship with an incorrect or missing StartupWMClass?
I've noticed a pattern over the years that I'm curious about.
A surprising number of Linux applications, especially smaller projects on GitHub, seem to ship with an incorrect or missing StartupWMClass value in their .desktop file. The result is that when I launch the application from a pinned icon, the running window does not associate with it. Instead, a second icon, often a generic one, appears in the dock or taskbar.
In all cases I can fix it by checking the application's actual WM_CLASS value with xprop and updating the .desktop file to match. Once StartupWMClass is correct, the launcher and running window consolidate into a single icon as expected.
At this point it only takes me a minute to fix, but when I was new to Linux it was incredibly confusing because I had no idea why it was happening or how to resolve it.
My question is whether this is simply something developers frequently overlook, or if there are legitimate reasons why it is often left out or ends up being incorrect. Is it harder to get right than it seems, or is it just an easy detail to miss during development and packaging?
I'm interested in hearing from people who package or develop Linux desktop applications. Is there more to this than meets the eye?