When opening a new Firefox window, window surface may initially appear white (causing a flash in dark mode)
Categories
(Core :: Widget: Win32, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox129 | --- | verified |
People
(Reporter: e412byoy7, Assigned: rkraesig)
References
(Regressed 2 open bugs)
Details
Attachments
(4 files, 1 obsolete file)
Bug 1824053 - [1/4] Remove Win32 implementation of nsIWidget::SetBackgroundColor() r?#win-reviewers!
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0
Steps to reproduce:
- Open Firefox
- In Firefox settings, switch the "Website appearance" option from "Automatic" to "Dark".
- Open 2 tabs with both having dark pages loaded (for example YouTube.com . It should appear dark automatically due to the Firefox website appearance setting, otherwise use "appearance" setting in YouTube set to "dark".)
- now hold left mousebutton on one tab down and drag the tab out of the tab-bar (to split the Firefox window into two separate windows, in each being one tab).
- release mousebutton
Actual results:
the entire selected window shortly brightly flashes in white (possibly due to some kind of redraw-function?)
Expected results:
The window should not flash in a very bright color if the Firefox "Website appearance" option is set to "Dark", but rather in an eye-friendly black color or very dark color, to not cause a massive short contrast moment for users who are interacting with mostly dark-design websites. (This issue getting fixed also might be a big welcome to all seizure-sensitive people.)
clarification for "actual results:" the window shortly brightly flashes in white, before the actual website successfully loads and appears. (it loads in a splitsecond however, due to caching, so loading-time of the actual website itself can be ignored as far as I know)
![]() |
||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 3•1 year ago
|
||
Much to my surprise, this appears to be a (mis)feature of DWM itself! This StackOverflow link has some detailed third-party investigation, as well as several known workarounds of various degrees of effectiveness and intrusiveness.
We should be able to implement one of them without much difficulty — most likely some variant of "cloak before showing".
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 5•1 year ago
|
||
This never worked according to its description: it merely set the
window-class background-color. We neither have nor need any mechanism
to give individual windows their own per-widget background color under
Win32.
Instead, we just set the background color to be dark grey, which is
probably good enough for the few purposes for which the background brush
is actually used. (Alas, this does not quite include the initial white
flash.)
The comment in this bug about this being important for Windows dates
from bug 574638, and is no longer relevant -- at least, not in the
particular way it used to be.
Assignee | ||
Comment 6•1 year ago
|
||
DWM will draw our window's surface before we get a chance to clear it:
specifically it will draw the window immediately upon ::ShowWindow(),
and we cannot draw to the window surface before that.
We can, however, cloak the window before showing it; this causes DWM
not to composite it until it's uncloaked. A cloaked window still has a
drawable surface, though, so we just manually clear the window with an
appropriate color before its uncloaking.
Assignee | ||
Comment 7•1 year ago
|
||
Cleanup prior to the addition of new code. No functional changes.
Assignee | ||
Comment 8•1 year ago
|
||
When creating the skeleton UI window, cloak and clear it to a theme-
appropriate color before first showing it, just as is done in nsWindow.
Comment 10•1 year ago
|
||
Comment 11•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/49613184d359
https://hg.mozilla.org/mozilla-central/rev/48521d359050
https://hg.mozilla.org/mozilla-central/rev/f5f062211a87
https://hg.mozilla.org/mozilla-central/rev/25851866b7b7
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 12•1 year ago
|
||
I was unable to reproduce the issue as described in Comment 1 while using Nightly 129.0a1 on Windows10 x64. @Dan, could you please confirm if the issue persists in the latest Firefox 129.0b7? Thank you.
Reporter | ||
Comment 13•1 year ago
|
||
Fixed in latest Beta "129.0" for me too, yes, thanks!!
Comment 14•1 year ago
|
||
Thank you for confirming. Updating the remaining flags as well.
Comment hidden (obsolete) |
Comment 16•9 months ago
|
||
Comment on attachment 9435586 [details]
Bug 1824053 - [5/4] Correctly set flag after initial ::Show() r?emilio,handyman
Revision D228108 was moved to bug 1929413. Setting attachment 9435586 [details] to obsolete.
Assignee | ||
Comment 17•9 months ago
|
||
(Sorry about that, all! Nothing to see here.)
Description
•