Firefox snap opens a black window on wayland

Bug #2016918 reported by Gunnar Hjalmarsson
This bug report is a duplicate of:  Bug #1987976: firefox black window on wayland. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mutter
New
Unknown
firefox (Ubuntu)
New
Undecided
Unassigned
mutter (Ubuntu)
In Progress
High
Gunnar Hjalmarsson
xwayland (Ubuntu)
New
Undecided
Unassigned

Bug Description

This may actually be a duplicate of bug #1987976, but I was advised to file a new bug to get attention to this issue for the 23.04 release and consider a possible workaround.

https://irclogs.ubuntu.com/2023/04/18/%23ubuntu-desktop.html#t17:42

In short: On a fresh 23.04 install, the first time in each wayland session I try to launch Firefox via the icon in the dock, it just opens a black window. I can close Firefox, and try again, and then it opens as expected.

I'd better mention that I have a NVIDIA card, but the issue is present both with the NVIDIA and the Nouveau driver.

While it might be some kind of race condition (not everyone is affected), in my case it happens every time.

I have a proposed workaround: use the xrefresh command. That could for instance be done with this file:

$ cat /etc/xdg/autostart/firefox-snap-launch-xwayland.desktop
[Desktop Entry]
Name=Launch Xwayland on startup of wayland session
Comment=This allows to start the Firefox snap from the dock without a black window
Type=Application
Exec=sh -c 'if [ "$XDG_SESSION_TYPE" = "wayland" ]; then xrefresh; fi'
TryExec=xrefresh
OnlyShowIn=GNOME;
NoDisplay=true

That idea isn't new. We have shipped a similar file (for a similar reason) with ibus-mozc for a few cycles:

https://salsa.debian.org/debian/mozc/-/commit/4e48b655

Changed in mutter:
status: Unknown → New
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

I applied a mutter patch written by Marco Trevisan and uploaded to a PPA:

https://launchpad.net/~gunnarhj/+archive/ubuntu/mutter

With the binaries from that PPA build I can no longer reproduce the black window issue described in this bug. Not even after having run:

killall Xwayland

So I pushed the patch to the repo.

https://salsa.debian.org/gnome-team/mutter/-/commit/a400e60d

Changed in mutter (Ubuntu):
status: New → In Progress
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Let's use the original bug report instead.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.