Page 1 of 1

Incorrect capitalisation of StartupWMClass desktop file entry

Posted: 2021-04-29, 11:44
by OPNA2608
The StartupWMClass entry of the official branding has the wrong capitalisation. It's "pale moon" in the desktop file, but running

Code: Select all

xprop WM_CLASS
on a Pale Moon window gives me:

Code: Select all

WM_CLASS(STRING) = "Navigator", "Pale moon"
I haven't checked if elementary OS (who develop the DE & dock application fork) behaves the same but on NixOS with the Pantheon DE enabled, this causes the dock to not properly associate Pale Moon windows with the palemoon.desktop entry. I currently hack this in my packaging with

Code: Select all

    substituteInPlace ./palemoon/branding/official/palemoon.desktop \
      --replace 'StartupWMClass="pale moon"' 'StartupWMClass=Pale moon'
and that fixes the dock problems for me. Iunno if the problem is with Pantheon / the dock doing a case-sentive WM_CLASS property check when they really shouldn't or everyone else just being more lenient in their matching than the specs require them to (it's prolly the former?), but it's such a small fix that I can't imagine it having any downsides.

I'll provide screengrabs of stock & fixed behaviour this evening. I'm currently not on my system with the affected DE - I'm just bumping our package to the new release, remembered that I applied that fix awhile ago & figured I should report it since it seems to work fine with the limited testing that I've done.

Re: Incorrect capitalisation of StartupWMClass desktop file entry

Posted: 2021-04-29, 20:59
by OPNA2608
It's actually more than just the lowercase p, it's the extra quotation marks as well. I have built 4 isolated packages, the only difference between them being the StartupWMClass setting in their share/applications/palemoon.desktop file:

A: "pale moon" (what's being shipped in your repo)
B: Pale moon (what I've fixed it to)
C: "Pale moon"
D: pale moon
  1. I uninstalled my current Pale Moon package from my system and scrubbed all local application overrides related to it. Then I logged out & back into my desktop to make the DE rescan the desktop file related paths. Searching "Pale Moon" in my applications list yielded no results.
  2. I installed package A. I logged out & back in, searched for Pale Moon. I dragged it from my applications list to my dock and launched it from there.
    The first Pale Moon icon is the desktop file I pinned to my tab, the second one with the blue dot on the bottom is the Pale Moon window that was launched + an indicator for the amount of windows associated with that application.
  3. I removed the pin from my dock, uninstalled this package from my system, scrubbed everything again, logged out & back in. Pale Moon was now gone from my list again.
  4. I installed package B next, relogged in, pinned the search result to my dock.
    Note that this time, there is only 1 Pale Moon icon on the dock & the window indicator is under it.
  5. I verified this result by uninstalling & reinstalling the B package again (+ all the scrubbing & relogging): Pin<->Window association still works.
  6. I then sanity checked by uninstalling & reinstalling the A package (+ all the scrubbing & relogging): Pin was broken and gave me 2 Pale Moon icons on my dock.
  7. I next tested packages C and D, and both of them resulted in broken pins.
So I think changing that value to Pale moon would be the right fix. I'm curious though, can anyone else replicate such a problem on their Pantheon DE, or any other DE? Or does the fixed value cause any problems on another DE perhaps?