Closed Bug 1863262 Opened 1 year ago Closed 1 year ago

Thunderbird wayland flatpak in Plasma wayland shows default icon in overview and task switcher

Categories

(Thunderbird :: Build Config, defect)

x86_64
Linux
defect

Tracking

(thunderbird_esr115 fixed, thunderbird120 fixed)

RESOLVED FIXED
121 Branch
Tracking Status
thunderbird_esr115 --- fixed
thunderbird120 --- fixed

People

(Reporter: bbhtt.zn0i8, Assigned: dandarnell)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

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

Steps to reproduce:

  1. Run plasma wayland
  2. Remove the distribution provided firefox or anything that provides an icon and desktop named "thunderbird"
  3. flatpak install flathub org.mozilla.Thunderbird
  4. flatpak run --env=MOZ_ENABLE_WAYLAND=1 org.mozilla.Thunderbird
  5. Go to plasma overview, see that the icon is the default wayland icon

This is split off from the firefox counterpart https://bugzilla.mozilla.org/show_bug.cgi?id=1856778, the explanation is there

Actual results:

$ flatpak run --env=WAYLAND_DEBUG=1 --env=MOZ_ENABLE_WAYLAND=1 org.mozilla.Thunderbird
....
xdg_toplevel@62.set_app_id("thunderbird")

app-id does not match the desktop file name which is FLATPAK_ID ie. org.mozilla.Thunderbird. KDE wayland expects them to match to find the icon.

OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Attached image 9ff9bc4ff8.png
Attached image 412a624bf5.png
Component: Untriaged → Build Config

From the Firefox bug:

The Mozilla firefox build has the app-id firefox, so the fix would be to supply the --name org.mozilla.firefox to the launch script here https://hg.mozilla.org/mozilla-central/raw-file/33f0079fba2d08c293f0a63890fa88c78e2550ec/taskcluster/docker/firefox-flatpak/launch-script.sh I believe.

Daniel, can you take a look at making this change? This may break other things though, DBUS stuff in particular.

Assignee: nobody → daniel
See Also: → 1856778

I don't think this will affect any dbus stuff, --name uses g_set_prgname https://gitlab.gnome.org/GNOME/gtk/-/blob/c47425c62efb99be8cd2f0eea651dda76a99ba04/gdk/gdk.c#L219-L224 while the dbus names used are a sanitised version of MOZ_APP_REMOTINGNAME, see toolkit/components/remote/nsDBusRemoteServer.cpp, nsDBusRemoteClient.cpp. Unless that is overridden in official builds, it'll always be thunderbird-<release channel> and the bus name thunderbird_<release channel>.

This is also the reason why the official flatpak has to grant --own-name access (flatpak by default allows an app to own access to the bus/sub bus name named by its flatpak id), but flatpak id here is different from the actual app id which is again different from the bus names used.

Ideally all 3 should match, the current app id - "thunderbird" is wrong per the spec https://wayland.app/protocols/xdg-shell#xdg_toplevel:request:set_app_id, it should be in rDNS format and follow the DBus bus naming specification.

(In reply to bbhtt from comment #4)

I don't think this will affect any dbus stuff, --name uses g_set_prgname https://gitlab.gnome.org/GNOME/gtk/-/blob/c47425c62efb99be8cd2f0eea651dda76a99ba04/gdk/gdk.c#L219-L224 while the dbus names used are a sanitised version of MOZ_APP_REMOTINGNAME, see toolkit/components/remote/nsDBusRemoteServer.cpp, nsDBusRemoteClient.cpp. Unless that is overridden in official builds, it'll always be thunderbird-<release channel> and the bus name thunderbird_<release channel>.

This is also the reason why the official flatpak has to grant --own-name access (flatpak by default allows an app to own access to the bus/sub bus name named by its flatpak id), but flatpak id here is different from the actual app id which is again different from the bus names used.

Ideally all 3 should match, the current app id - "thunderbird" is wrong per the spec https://wayland.app/protocols/xdg-shell#xdg_toplevel:request:set_app_id, it should be in rDNS format and follow the DBus bus naming specification.

I've submitted a patch to pass in the correct app ID for Wayland.

On your other note, our thinking for not changing the Flatpak ID to match the bus names is that if we did, everybody who was using the unofficial Thunderbird Flatpak before we took over would have to re-download the new Flatpak manually (updates would not work from unofficial > official TB). Since the unofficial Flatpak used "org.mozilla.Thunderbird" as it's Flatpak ID.

Flatpak supports --end-of-life-rebase=OLDID=NEWID option that marks OLDID as EOL and trigger automatic download of NEWID alongside data migration.

In flathub internal infra this is as easy as adding single line in a file: https://github.com/flathub/com.valvesoftware.Steam.Utility.MangoHud/blob/4d76f26cbc69876ea1525e5fde12151c46930820/flathub.json#L4

You would need to consult flatub admins how to achieve this from 3rd party infra or leave things as they are.

Comment on attachment 9363414 [details]
Bug 1863262 - Fix Thunderbird Flatpak app ID in Wayland. r=#thunderbird-build-system-reviewers

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: Under certain circumstances, the Thunderbird icon will not appear under KDE Plasma when using Wayland.
Testing completed (on c-c, etc.): Local testing on VM.
Risk to taking this patch (and alternatives if risky): Low

Attachment #9363414 - Flags: approval-comm-beta?
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → 121 Branch

Comment on attachment 9363414 [details]
Bug 1863262 - Fix Thunderbird Flatpak app ID in Wayland. r=#thunderbird-build-system-reviewers

[Triage Comment]
Approved for beta

Attachment #9363414 - Flags: approval-comm-beta? → approval-comm-beta+

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/bc76495b943d
Fix Thunderbird Flatpak app ID in Wayland. r=rjl

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED

Comment on attachment 9363414 [details]
Bug 1863262 - Fix Thunderbird Flatpak app ID in Wayland. r=#thunderbird-build-system-reviewers

[Triage Comment]
Approved for 115.5.0 as discussed with wsmwk and dandarnell

Attachment #9363414 - Flags: approval-comm-esr115+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: