Score:1

Firefox show black screen on first time run when using Wayland

se flag

I've installed Ubuntu 22.04 on an old Dell Vostro 1700 laptop with 4GB of RAM and 17" display 1440x900. Everything's working fine but there is one small thing which is annoying me.

I have installed the minimal installation and then installed additional packages I wanted. Among them Firefox which has been installed as snap version.

If I login using Wayland, the first time I try to start Firefox I can see only a black screen. If I quit the application and I start the application again then it's working fine. This happens if I try to run Firefox by clicking the icon on the left or if I start Firefox from the terminal windows by typing firefox.

After some checks, I have noticed that this happens only in Wayland. If I start with Xorg then this problem does not occur.

Here the info about the Firefox version installed:

name:      firefox
summary:   Mozilla Firefox web browser
publisher: Mozilla✓
store-url: https://snapcraft.io/firefox
contact:   https://support.mozilla.org/kb/file-bug-report-or-feature-request-mozilla
license:   unset
description: |
  Firefox is a powerful, extensible web browser with support for modern web
  application technologies.
commands:
  - firefox
  - firefox.geckodriver
snap-id:      3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk
tracking:     latest/stable/ubuntu-22.04
refresh-date: 4 days ago, at 06:30 CET
channels:
  latest/stable:    110.0-3      2023-02-16 (2356) 252MB -
  latest/candidate: 110.0-3      2023-02-14 (2356) 252MB -
  latest/beta:      111.0b2-1    2023-02-17 (2370) 192MB -
  latest/edge:      112.0a1      2023-02-18 (2373) 197MB -
  esr/stable:       102.8.0esr-2 2023-02-16 (2364) 185MB -
  esr/candidate:    102.8.0esr-2 2023-02-16 (2364) 185MB -
  esr/beta:         ↑                                    
  esr/edge:         ↑                                    
installed:          110.0-3                 (2356) 252MB -

Is there any log where I can get some more information about this behavior?

I found in the internet, on a post on reddit.com, someone reporting the same issue. Any suggestion?

Kind regards, Al

adasiko avatar
de flag
about:support -> "Graphics" section -> Window Protocol. wayland or xwayland?
Score:1
ss flag

https://bbs.archlinux.org/viewtopic.php?id=258954

I had same problem just solved with above solution

You're running firefox over xwayland and you have to run that over Wayland by setting up an environment variable

After setting up environment variable just logout or reboot

BeastOfCaerbannog avatar
ca flag
The link you posted contains multiple posts. Could you be so kind and [edit] your answer to include the exact solution? Thanks!
Score:0
us flag

To resolve this problem, I added a environment variable :

sudo vim /etc/environment

then added the following line into the file :

MOZ_ENABLE_WAYLAND=1

Now firefox opens normally

Score:0
in flag

I'm still having the same issue on Ubuntu 23.04, which is kind of incredible, since I expect Firefox and Wayland to be the standard configuration nowadays.

I read the post mentioned in Yuvi's answer and came to the following solution:

For wayland sessions, add MOZ_ENABLE_WAYLAND=1 to your environment. This can be achieved by adding the following code to your ~/.profile (for login shells. This fixes clicking the Firefox icon in Gnome) and to your ~/.bashrc (for non-login shells. This fixes running firefox from the Gnome Terminal).

if [ "$XDG_SESSION_TYPE" == "wayland" ] ; then
  export MOZ_ENABLE_WAYLAND=1
fi
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.