Saturday, March 5, 2022

Firefox on Wayland

I'm using the Firefox release version from Ubuntuzilla on Debian Testing running Gnome, which uses Wayland by default now, so I wondered, does Firefox use Wayland by default? The answer is no, but it is fairly easy to enable it and it seems to work well, with a claimed significant improvement in rendering performance.

To enable Wayland mode in Firefox, edit

/usr/share/applications/firefox-mozilla-build.desktop

to

Exec=env MOZ_ENABLE_WAYLAND=1 firefox %u

(This will also work with other builds of Firefox and executable paths. See StackExchange.)

To get the performance increase in rendering, set

gfx.webrender.compositor.force-enabled 

to true in about:config. (Arch Wiki)

There is a bug which results in the window icon and title not displaying.

To correct this I had to change the line

StartupWMClass=Firefox

in the desktop file above to

StartupWMClass=firefox

(StartupWMClass must match the executable name exactly.)

I found the solution in this bug report, of which the previous bug is a duplicate, although more descriptive of this issue.