Le Tue, Apr 18, 2023 at 10:20:54PM +0200, Joel Carnat a écrit :
> Le 18/04/2023 à 16:08, Landry Breuil a écrit :
> > > 
> > > Can you try removing the '-default' suffixing horror, and just add
> > > StartupWMClass=firefox (or thunderbird, or firefox-esr..) to your custom
> > > desktop file and check this also fixes the problem ?
> > > 
> > > The firefox-flatpak desktop file has a bit more actions, more
> > > translations, and seems better maintained upstream, so instead of
> > > setting MOZ_APP_REMOTINGNAME in the build i'd rather switch to this
> > > desktop file as a source for the one we install in the package.
> > > 
> > > My understanding of the root issue is that docklike relies on the
> > > WM_CLASS value to match running processes, which doesnt work for mozilla
> > > windows because of the -default suffix.  You can see for yourself what
> > > is the WM_CLASS for all existing windows using 'xlsclients', that might
> > > also show other applications behaving weird.
> > 
> > Thinking more about it, i'm not sure fixing the desktop file is enough,
> > since that only might account for the browsers launched from clicking on
> > a proper launcher, and might not have the same behaviour with starting
> > "firefox" in a terminal.
> > 
> > More testing needed, but feedback on the rationale more than welcome !
> > 
> > Landry
> > 
> 
> I have tested various combination and long-story-short, nothing worked
> except the dirty modification of Exec. StartupWMClass doesn't seem to be
> taken in account, or at least WM_CLASS isn't changed (tested with xprop).
> 
> Using `firefox --class firefox` from xterm does show the proper icon. You
> can then pin it on docklike. But it is pinned without the flags. You have to
> edit the launcher to add "--class firefox". Then, clicking docklike icon
> will start Firefox with the overwritten class and show the icon.
> 
> I have noticed that when you modify the launcher from docklike, it
> automatically modifies ~/.local/share/applications/firefox.desktop with
> "Exec=firefox --class firefox %u".

Was all this testing with standard packages, or my wip packages setting
MOZ_APP_REMOTINGNAME ?

> Note that Thunderbird also has the StartupWMClass in the default desktop
> file ; and the icon is ignored. I have also seen
> /usr/local/share/applications/writer.desktop having "Exec=libreoffice7.5
> --writer %U" in the stock file.

And.. what is the behaviour for writer ? works ? wrong icon ? wrong
class ?
For thunderbird the issue is the same as firefox, it has 'thunderbird-default' 
as
WM_CLASS:
WM_CLASS(STRING) = "Mail", "thunderbird-default"
and the desktop file is wrong too, since it has 'StartupWMClass=Thunderbird-bin'
which doesnt match the binary name nor the WM_CLASS.

To my understanding, for the icon to work (in all situations, eg
launched from a terminal or from a command in a shell), the value in
xlsclients (set via --class arg on the commandline or gdk_set_wm_class()
in the code) has to match the binary name.

Landry

Reply via email to