Closed Bug 1760468 Opened 4 years ago Closed 3 years ago

About Firefox window renders blank initially

Categories

(Core :: Widget: Gtk, defect)

Firefox 98
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: thomas-lange2, Unassigned)

Details

Attachments

(2 files, 2 obsolete files)

Attached video Screencast.mp4 (obsolete) —

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0

Steps to reproduce:

Open the "About Firefox" dialog

Actual results:

The dialog is rendered blank initially. Its content only appears when you move it around to get it redrawn. A short video showing this is attached.

System information:

  • Arch Linux
  • Xfce 4.16 with Xfwm4 as windows manager
  • Firefox 98.0.1

This happens also with a clean Firefox profile. But it does not occur with Firefox downloaded from https://mozilla.org/firefox.

Maybe the update check redraws the window. And since Linux distributions usually disable the updater for their repository packages, this issue may occur?

Expected results:

The dialog content is visible right away.

Attached file Firefox-1760468.mp4.zip (obsolete) —
Attachment #9268577 - Attachment is obsolete: true

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Attached video Firefox-1760468.webm
Attachment #9268578 - Attachment is obsolete: true

I have attempted reproduction on Ubuntu v20.04.4 LTS with Release v98.0, v98.0.2 and v99.0 (non-Snap build, but downloadable version from archive, xwayland window protocol). Could not reproduce anything similar to the video.
When opening the latest Snap version v99.0 (wayland window protocol), I could not reproduce either.

I have also attempted reproduction on Ubuntu 21.10 with Release v98.0, v98.0.2 and v99.0 (non-Snap build, but downloadable version from archive, xwayland window protocol) and on Release v99.0, canonical/snap build, wayland window protocol. No luck in reproducing it.

The About window renders correctly every time.

It appears that this issue might be specific to the ArchLinux, maybe ArchLinux with X11 Window Protocol; could also be the Xfce 4.16 with Xfwm4 as windows manager.

I cannot confirm, nor investigate this issue considering I can't reproduce it.

QA Whiteboard: QA-not-reproducible

I can reproduce this bug as well.

It appears that this bug only appears with recent versions of Mesa. In particular, it only occurs with Mesa >=22.0 for me. (Ubuntu 20.04 LTS currently ships Mesa 21.2; the newer Ubuntu 22.04 LTS release has Mesa 22.0).

I'm using an AMD graphics card (with the open-source amdgpu + Mesa radeonsi drivers).

The bug also appears in versions of Firefox that have the integrated auto-updater enabled; however, it manifests slightly differently there because the auto-updater shows an animation on the "About Firefox" window, which forces a repaint, thereby masking the bug. It can still be triggered by resizing the window from the right side once that animation has finished, in which case the window doesn't repaint properly. I'll attach a screenshot of this.

I'll try checking if this is a Mesa bug too.

Attached image firefox-repaint-bug.png

Repaint bug on Nightly. Due to the auto-updater animation, which forces a repaint, the bug is only visible after resizing the window.

Good to know that I am not the only one who can reproduce this bug. :)

My main computer uses the amdgpu/radeonsi graphics driver, but the issue occurs also on a laptop with an Intel GPU.
Ubuntu implies you use Gnome, right? This would mean it cannot be a bug in Xfwm4 (the window manager for Xfce).

I'm on Debian Testing actually; I just looked up which version of Mesa Ubuntu ships at the moment to explain why it didn't reproduce.

At the moment I'm using Mesa 22.1 and KDE 5.24.5 (X11) but that also implies it can't be the window manager, given that KDE has a completely different WM than Xfce.

Turns out it's not Mesa. I've tried bisecting but even Mesa 21.2 is exhibiting the bug, which was good when danibodea tested it on Ubuntu. So it must be caused by some of the other window management libraries used by Firefox. I'll try to figure out which one it is.

The Firefox Snap package is not exhibiting the bug on my system, which means that the difference must be in some library that's included in that package.

I managed to track it down. It's got something to do with the version of Cairo that Firefox loads.

The bug occurs when libcairo is built with xlib-xcb disabled in the Meson build system.

Good: libcairo 1.17.6 with xlib-xcb=enabled
Bad: libcairo 1.17.6 with xlib-xcb=disabled

Enabling xlib-xcb in libcairo also seems to fix a bunch of other (less noticeable) visual glitches in Firefox for me.

It'd be great if you could try this out too, Thomas. Clone Cairo, then do this to test if the glitch still occurs:

git clone https://gitlab.freedesktop.org/cairo/cairo.git
cd cairo
git checkout 1.17.6
meson setup meson-build
meson configure -Dxlib-xcb=enabled meson-build
ninja -C meson-build
LD_PRELOAD=$(pwd)/meson-build/src/libcairo.so.2.11706.0 firefox

Now one question remains: Why? Is this a Cairo bug? Or a Firefox bug?

Good work Jonathan, enabling xlib-xcb indeed fixes this issue.

I have compiled Cairo with the official Arch PKGBUILD, but with "-D xlib-xcb=enabled". Even with libx11 and libxcb installed as dependency, xlib-xcb is not enabled by default.

Enabling xlib-xcb has unwanted side effects though... Segfaults when opening the Xfce logout dialog twice.
This may explain why it is disabled by default, with Meson and autotools.

https://github.com/archlinux/svntogit-packages/commit/82d608ffd17f0e41523ff98956dd43de0908e661
https://bugs.archlinux.org/task/68839
https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/132

Does anyone have the Nvidia driver installed? It can cause transparent/blank windows, too: bug 1745172 comment 14

No, my system is Nvidia-free. The only graphics driver that's installed is Mesa (radeonsi/radv with a Radeon Pro W6800). Thomas' systems have AMD and Intel graphics, respectively.

I'm no longer able to reproduce this bug with Firefox 103. :)
@Jonathan: Can you confirm this?

Can confirm, this seems to be fixed with 103!

@stransky: Could you please mark this as resolved? I can't do it myself as reporter.

Closing based on the latest comments. Thank you for your contributions!

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: