[Linux] Firefox window is transparent / flashing right after browser start
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox97 | --- | fixed |
People
(Reporter: stransky, Assigned: emilio)
References
Details
Attachments
(1 file)
Before we paint UI/web content the Firefox window is empty and transparent so you see desktop background. Firefox on Windows use a placeholder screen which is replaced by actual Firefox content when we're loaded.
I wonder if we can use such placeholder on Linux too.
| Reporter | ||
Comment 1•3 years ago
|
||
The placeholder on Window look like a normal Firefox window but has empty area for web content and bold gray line instead of URL.
Comment 2•3 years ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #0)
Before we paint UI/web content the Firefox window is empty and transparent so you see desktop background. Firefox on Windows use a placeholder screen which is replaced by actual Firefox content when we're loaded.
We used to at least paint a blank window (using about:blank). Do you know why that is not working, ie why is it transparent rather than white/black? Is that a regression? Does it happen with/without webrender and/or wayland?
I wonder if we can use such placeholder on Linux too.
This part feels like a separate enhancement. It should be a smaller lift to fix the transparency, at least.
Comment 3•3 years ago
|
||
Looks like the blank window bit should work on nightly, per bug 1450626 and https://searchfox.org/mozilla-central/rev/70b32246fce5ca1f53af573a21c1939df58cb969/browser/app/profile/firefox.js#309 .
| Reporter | ||
Comment 4•3 years ago
|
||
We can postpone window show at widget level or set the transparency later and show just blank window. The problem is that widget code does not know when the window has a valid content - can this be obtained somehow?
Comment 5•3 years ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #4)
We can postpone window show at widget level or set the transparency later and show just blank window. The problem is that widget code does not know when the window has a valid content - can this be obtained somehow?
I'm not sure what you mean by "valid content" in this context, or why we're showing a window before we've loaded DOM content for it that we can present (assuming that's what "valid content" means?). Even if we do though, I would have thought we could at least paint the default window background colour, which comes from the gtk theming prefs anyway, right? But I'm guessing :dthayer and/or :emilio can give you better answers here.
| Reporter | ||
Comment 6•3 years ago
|
||
Yes, I think default background would be sufficient here. It's visible in debug build - we show Firefox window (which is transparent by default) but it takes another 2-3 seconds until some content is painted.
| Reporter | ||
Comment 7•3 years ago
|
||
hm, it may be handled on widget level - we know that the window is painted to on compositor widget level.
| Assignee | ||
Comment 8•3 years ago
|
||
Something like this mostly works, except for the fact that it breaks
rounded corners because we still clear with the opaque color behind
them.
| Assignee | ||
Comment 9•3 years ago
|
||
Sorry for the lag. The patch above seems to work except for the issue hinted in the comment. We might be able to set the clear color to transparent after we've painted the chrome document. The issue is what's the best way to detect it.
| Assignee | ||
Comment 10•3 years ago
|
||
Martin pointed that perhaps a better way is delaying the call to https://searchfox.org/mozilla-central/rev/253ae246f642fe9619597f44de3b087f94e45a2d/widget/gtk/nsWindow.cpp#5689
Updated•3 years ago
|
| Assignee | ||
Comment 11•3 years ago
|
||
removing that call or making that call pass false worked on wayland but not x11 (and still didn't show the rounded corners properly), so I went ahead with my initial solution, it wasn't a lot of work.
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
Comment 14•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/7e3cdb88790d
https://hg.mozilla.org/mozilla-central/rev/c4d886e0717a
Updated•3 years ago
|
Comment 15•3 years ago
|
||
Did we do any talos checks on this? I'm guessing this is going to move paint / window opening numbers, though I have no idea in which direction...
| Assignee | ||
Comment 16•3 years ago
|
||
I didn't, but I don't know why it would have any measurable effect on performance?
It doesn't really change how much paint work is done, just with which color does WR do the clear (so at most two more IPC messages with just one uint32_t each).
| Assignee | ||
Comment 17•3 years ago
|
||
I mean, conceptually the OS compositor could optimize something with the opaque clear color, so it could be faster, but it's hard to imagine how would it get that information without us telling it.
Comment 18•3 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #16)
I didn't, but I don't know why it would have any measurable effect on performance?
Ah, sorry, I think I got confused wrt the idea of postponing one of the calls (comment #4 / comment #10), but I guess that's not the fix we went with.
Comment 19•3 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #17)
I mean, conceptually the OS compositor could optimize something with the opaque clear color, so it could be faster, but it's hard to imagine how would it get that information without us telling it.
Just for the record:
Current hardware architectures don't allow fast checks on color opaqueness which is why on both Wayland and X11/EWMH there exists the concept of opaque-regions - a compositor hint that the area/region can be optimized. We did already set that hint before this patch, leading to small glitches if the background behind Firefox changed while the window still appeared transparent (I saw that a lot when launching a fresh debug build from terminal, as the terminal prints lots of stuff). So no, no performance differences expected from the compositor side (but the patch fixes an actual bug from the compositors point of view).
Comment 20•1 year ago
|
||
The bug was closed 3 years old and doesn't seem to require any action, so clearing needinfo.
Description
•