Tuesday, January 31, 2023

Re: Titlebar in firefox and tor-browser

On Tue, Jan 31, 2023 at 5:20 PM Julian Smith <jules@op59.net> wrote:
>
> On OpenBSD 7.2 with Fvwm2 (fvwm2-2.6.9p1), Firefox (firefox-107.0) and
> Tor-browser (tor-browser-11.5.6) both appear to not set the window
> titlebar to the current tab's text.
>
> Instead, the titlebar is always set to "Mozilla Firefox" or "Tor
> Browser".
>
> Is this expected? Is there any way to make the titlebar show the
> current Tab's text?
>
> I think OpenBSD 7.0 used to set the titlebar text as expected. I had a
> look in /usr/ports/www/mozilla-firefox/, but couldn't see anything
> obvious.

I can confirm this same functionality on amd64/7.2-stable with MLVWM
(mlvwm-0.9.3) and Firefox (firefox-107.0.1). As the MLVWM developer
(and port maintainer), I know that it, like fvwm in base, only draws
the window title from `WM_TITLE` (C_STRING, STRING, or
COMPOUND_STRING), not the newer `_NET_WM_NAME` (UTF8_STRING)
extension. Due to incompatible licensing, I haven't perused the source
for fvwm2 from ports, so it might differ. My guess is that Firefox has
stopped setting `WM_TITLE` with the tab name and only sets it in the
UTF-8 `_NET_WM_NAME`.

I ran into a related regression in SDL[0][1] a while ago, which has
since been fixed, where they stopped setting `WM_TITLE` because they
felt it was superseded by `_NET_WM_NAME`. According to the ICCCM spec,
`WM_TITLE` should always be set, and for window managers supporting
NetWM/EWMH (Extended Window Manager Hints) where `X_HAVE_UTF8_STRING`,
the window manager should use `_NET_WM_NAME` instead. Unfortunately,
many application developers have decided (incorrectly, IMHO) that this
means `_NET_WM_NAME` replaces `WM_TITLE` and doesn't need to be set
anymore (because it's harder... it's not UTF-8, so they have to check
encodings and encode the string correctly & appropriately.) I know
Thomas Adam, one of the fvwm3 developers, and I have discussed this
particular interpretation before too.

Running `xprop` on a Firefox window with the OpenBSD homepage loaded
confirms my suspicions:

WM_NAME(STRING) = "Mozilla Firefox"
_NET_WM_NAME(UTF8_STRING) = "OpenBSD — Mozilla Firefox"

So, I'd suggest submitting a bug report upstream w/Firefox. (I believe
the Firefox codebase is used for Thunderbird, as well, so I suspect
this issue affects it too.)

[0] - <https://github.com/libsdl-org/SDL/issues/4924#issuecomment-973147103>
[1] - <https://github.com/libsdl-org/SDL/issues/4924#issuecomment-981145120>

--
Morgan Aldridge

No comments:

Post a Comment