screenshot of the firefox black screen bug in ubuntu 23.04

Do you see a pitch black window when you open Firefox on Ubuntu 23.04?

If so, you’re not alone.

Thing is, until today, I thought I was alone. I thought this issue, which I’ve only experienced when using Ubuntu’s default Wayland session and the preinstalled Mozilla Firefox snap app — i.e. a config that should “just work” in theory — was a quirk of my Lunar system.

Or worse: my fault (I do install/tweak my system a lot).

Well I’m relieved to say I’m not to blame, and neither are you.

Firefox’s black screen of death in Lunar is actually a Mutter issue related to Xwayland. Ubuntu devs are aware of it and, I’m pleased to say, a fix is already en-route as I write this.

So what’s been going on?

To quote from the bug report linked above:

On some systems, when you open the Firefox snap right after having logged in into an Ubuntu on Wayland session, you are met by a black window. This happens because the FF snap is run under Xwayland, and Xwayland may not be enabled early enough to handle the start of the application properly.

Ubuntu devs have tweaked Mutter to prevent this happening, and that update (mutter 44.0-2ubuntu4.23.04.1, if you’re interested) has been pushed out and will arrive as a regular software update to all Ubuntu 23.04 systems.

As the cause is in Mutter, Ubuntu dev supremo Marco Trevisan has submitted a patch upstream to set compositor selection earlier on XWayland.

In his merge request — which is merged and ready to ship as part of GNOME 45 – Marco gifts us a delicately-wrapped, eli5 explanation of the mechanics at (foul) play:

When the X11 display is actually XWayland there’s no point to delay the compositor selection, given that mutter itself is the compositor and doing this may cause the first X11 client that starts not to receive the right information (and in some cases misbehave). Since some toolkits are not handling the compositor selection changes properly at later times, let’s make their life easier by just initializing the selection as early as the other X11 properties, given that in this case there’s nothing to replace.

Excellent work, Watson. 🕵🏻‍♂️

tl;dr: Firefox showing a black screen on Ubuntu when you open it after logging in is a bug and a fix has been issued.

tl;dr2: Firefox black screen bug in Ubuntu 23.04 has been fixed.

tl;dr3: ⬛️😠🔜🌍😌

Firefox mutter Ubuntu 23.04