Package: firefox-esr
Version: 102.11.0esr-1

Debian's MOZ_APP_REMOTINGNAME is Firefox-esr, it should be lowercase firefox-esr as it is in builds from https://download.mozilla.org/?product=firefox-esr-latest-ssl&os=linux64.

MOZ_APP_REMOTINGNAME must match
- MOZ_APP_REMOTINGNAME.desktop to avoid https://bugzilla.mozilla.org/show_bug.cgi?id=1826330 on KDE Wayland
- StartupWMClass=MOZ_APP_REMOTINGNAME

$ cat /usr/share/applications/firefox-esr.desktop | grep StartupWMClass
> StartupWMClass=Firefox-esr

Wayland:
$ WAYLAND_DEBUG=1 MOZ_ENABLE_WAYLAND=1 firefox-esr |& grep 'xdg_toplevel@[0-9]\+\.set_app_id'
> [ 947103.838]  -> xdg_toplevel@43.set_app_id("Firefox-esr")

About/Downloads/bookmarks windows have a wrong window icon (the Wayland W icon).
With browser.tabs.inTitlebar=0, the main window has a wrong icon as well.

X11 / Xwayland:
When the cursor becomes a "+", click on Firefox' window:
$ firefox-esr & xprop WM_CLASS
> WM_CLASS(STRING) = "Navigator", "Firefox-esr"

Proposed fix:
https://salsa.debian.org/mozilla-team/firefox/-/blob/b2698cd93ded2aa17bb6a2756ee85f015b63dbe8/debian/rules#L76
> export MOZ_APP_REMOTINGNAME := $(call uc_first,$($(PRODUCT)))

I assume MOZ_APP_REMOTINGNAME needs to become PRODUCT, without uc_first.

MOZ_APP_REMOTINGNAME is used by Firefox
to call `g_set_prgname(gAppData->remotingName);` for correct window icon and grouping on Wayland (it can be overridden with --name argument) to call `gdk_set_program_class(gAppData->remotingName);` for correct window grouping on X11 (it can be overriden with --class argument)

And
https://salsa.debian.org/mozilla-team/firefox/-/blob/b2698cd93ded2aa17bb6a2756ee85f015b63dbe8/debian/browser.desktop.in#L103
> StartupWMClass=@MOZ_APP_REMOTINGNAME@

can become
StartupWMClass=@browser@


Offtopic, but further fixes for the .desktop file:
You can use the longer MimeType string from Mozilla's Nightly debian package (https://bugzilla.mozilla.org/show_bug.cgi?id=1836205#c3) to fix https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031041. "MimeType" doesn't change default apps and its order doesn't matter (https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#mime-types). You could also adopt "Actions" (plus "Desktop Action"s) and translations from it.

Reply via email to