Closed Bug 1893359 Opened 1 year ago Closed 1 year ago

[Flatpak]: Firefox does not set correct DesktopEntry property for MPRIS

Categories

(Core :: Widget: Gtk, defect)

Firefox 125
x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: bbhtt.zn0i8, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Attached image Screenshot from D-Spy

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0

Steps to reproduce:

Install GNOME 46/Fedora 40

Play media on Firefox Flatpak from Mozilla

See that the notification does not have the Firefox logo

Actual results:

The DesktopEntry is set to firefox (see attached image)

Expected results:

It should be set to org.mozilla.firefox

Attached image MPRIS witH Firefox icon

Workaround cp /var/lib/flatpak/exports/share/applications/org.mozilla.firefox.desktop ~/.local/share/applications/firefox.desktop and set NoDisplay=true

Pretty sure this is because of the wrong remoting name again.

Blocks: flatpak
Has STR: --- → yes
OS: Unspecified → Linux
Hardware: Unspecified → x86_64

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Pretty sure this is because of the wrong remoting name again.

If I'm reading this right, it's coming from the name of nsIXULAppInfo which is constant to firefox, it should probably be derived from the application ID or the remoting name instead.

Yes, we should use remotingName. But I have no idea where we set that for MPRIS, I can't find that in the code.

Flags: needinfo?(stransky)
Flags: needinfo?(stransky)
Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Unfortunately this won't solve the issue for Flatpak builds because it ships the official binary tarballs where the remoting name is firefox. But I guess not much can be done there until the Flatpak is compiled from source like the Snap.

(In reply to bbhtt from comment #8)

Unfortunately this won't solve the issue for Flatpak builds because it ships the official binary tarballs where the remoting name is firefox. But I guess not much can be done there until the Flatpak is compiled from source like the Snap.

You may use MOZ_APP_REMOTINGNAME to set remoting name:
https://searchfox.org/mozilla-central/rev/a44891c52387ca4bd7c35b50f0d335f3980ef36a/toolkit/xre/nsAppRunner.cpp#5860

Remoting name has to match desktop file name so it should work correctly as we use the same name for desktop file name and MPRIS desktop ID name, right? If it's broken on flatpak then flatpak may have broken Firefox icon too.

You may use MOZ_APP_REMOTINGNAME to set remoting name:
https://searchfox.org/mozilla-central/rev/a44891c52387ca4bd7c35b50f0d335f3980ef36a/toolkit/xre/nsAppRunner.cpp#5860

Oh, I didn't realise it existed in environment variable form too. Then I think it will work.

Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/8397cd70db46 [MPRIS] Use remoting name as desktop entry identifier r=emilio

Backed out for causing build bustages in MPRISServiceHandler.cpp

Flags: needinfo?(stransky)
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/de2302e247b0 [MPRIS] Use remoting name as desktop entry identifier r=emilio
Flags: needinfo?(stransky)
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
See Also: → 1935571
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: