Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Firefox-esr window class, missing desktop file
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 502

PostPosted: Sat Aug 05, 2023 12:30 am    Post subject: [Solved] Firefox-esr window class, missing desktop file Reply with quote

When firefox-bin:rapid is installed, the icon in KDE task manager appears normal. If I use firefox-bin:esr, the icon is a generic wayland (W) icon. The reason is that the window class (application) is defined as firefox-esr and the desktop file is not found. In contrast, the window class (application) in :rapid is found to be firefox-bin, which matches the name of the desktop file. The firefox binaries in both versions in a list of running processes are the same, both return as firefox-bin.

The name of the installed desktop file for both :rapid and :esr is firefox-bin.desktop. There are two workarounds, one is to create a symlink, firefox-bin.desktop >> firefox-esr.desktop or create a window rule in KDE Plasma to force change the 'desktop file name' from firefox-esr to firefox-bin.

When using a tool to detect the window properties of firefox, the window class (application name) is returned as firefox-bin in :rapid which matches the name of the running process and binary. In :esr, it returns as firefox-esr which does not match the name of the running process, the binary nor the desktop file, which creates the icon not found issue. I don't know if the difference in naming of the window class (application) in :esr was intentional or an oversight, but it leads to unexpected behavior that requires a workaround.

While it is a minor annoyance, I'd still like to mention the unintended side-effects to the devs. Should I do that upstream or here at Gentoo? Is there anything in the firefox-bin:esr ebuild that could define the window class/desktop file name or is this built into the binary upstream by Mozilla?

Thanks in advance!


Last edited by rab0171610 on Sat Aug 05, 2023 2:43 am; edited 1 time in total
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 502

PostPosted: Sat Aug 05, 2023 2:41 am    Post subject: Reply with quote

https://bugzilla.mozilla.org/show_bug.cgi?id=1530052
From that bug report, I found the simplest fix is to modify a desktop file in ~/.local/share/applications and add "--name=firefox" to the exec lines.
From:
Exec=firefox-bin %u
to:
Exec=firefox-bin --name=firefox %u
Back to top
View user's profile Send private message
Juippisi
Developer
Developer


Joined: 30 Sep 2005
Posts: 762
Location: /home

PostPosted: Sun Aug 06, 2023 8:28 am    Post subject: Reply with quote

You _should_ file a bug to make sure it isn't missed. Then we determine whether it's a Gentoo-related or upstream-related issue. Glad you solved it already though!

I committed https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26c29bca25ee97a853891ad98e5033e5863724ac in an attempt to fix this. I remember this being enough for the source-esr version, but I may remember wrong.
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 502

PostPosted: Sun Aug 06, 2023 5:10 pm    Post subject: Reply with quote

Thank you for your reply. If I am reading it correctly, this commit:
Code:
+   local desktop_filename="${PN}-esr.desktop"

Creates a desktop file named firefox-esr.desktop for the source version of firefox:esr? That does not happen with the current stable ebuild for firefox-bin:esr as far as I can tell (firefox.desktop is present, but firefox-esr.desktop is not). Would you still like me to file a bug report at Gentoo about this? That would also fix the issue I was having (firefox-esr.desktop not found).
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 502

PostPosted: Sun Aug 06, 2023 5:15 pm    Post subject: Reply with quote

Sorry for my confusion. I misread your post, and did not understand that change was made today in an attempt to fix the issue. Yes, if that creates /usr/share/applications/firefox-esr.desktop, then that fixes the problem. Thank you very much.

EDIT:: I am filing a bug report now with updated info. The new change results in /usr/share/applications/firefox-esr-bin.desktop vs /usr/share/applications/firefox-esr.desktop which leads to the same issues, "firefox-esr.desktop not found".
Back to top
View user's profile Send private message
Juippisi
Developer
Developer


Joined: 30 Sep 2005
Posts: 762
Location: /home

PostPosted: Tue Aug 08, 2023 5:43 am    Post subject: Reply with quote

rab0171610 wrote:
Sorry for my confusion. I misread your post, and did not understand that change was made today in an attempt to fix the issue. Yes, if that creates /usr/share/applications/firefox-esr.desktop, then that fixes the problem. Thank you very much.

EDIT:: I am filing a bug report now with updated info. The new change results in /usr/share/applications/firefox-esr-bin.desktop vs /usr/share/applications/firefox-esr.desktop which leads to the same issues, "firefox-esr.desktop not found".


Hmm, right, but we can't name it "firefox-esr.desktop" because it'd conflict with the source version. I guess I'll go with editing the .desktop file adding
Code:

--name=firefox %u
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 502

PostPosted: Tue Aug 08, 2023 6:32 am    Post subject: Reply with quote

That would work. Not to complicate the issue, but I did test another fix that I would like to point out. It involves simply changing the line in the desktop file:
Code:
StartupWMClass=firefox

to
Code:
StartupWMClass=firefox-esr

This corrects the window class issue and allows the binary to find or link to the desktop file and icon correctly in a Wayland session.
It appears to work independent of the name of desktop file (in test case changing desktop filename back and forth from firefox-bin-esr.desktop to firefox-bin.desktop.) It may be simpler and more direct solution than modifying the "exec=" parameters.

While not exact issue but related I came to that solution by reading:
https://bugzilla.mozilla.org/show_bug.cgi?id=1610305
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 502

PostPosted: Tue Aug 08, 2023 7:32 am    Post subject: Reply with quote

The updated ebuild, firefox-bin-102.14.0-r2.ebuild (esr) with the line:
Code:
local exec_command="${PN} --name=firefox

fixes the issues I was having on Wayland on two machines.

Thank you Juippisi for your hard work, time and consideration.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum