Introduction
Users of Microsoft Edge and Google Chrome have long reported a disruptive white flash when opening new browser windows in dark mode. This issue, prevalent on both Windows 10 and Windows 11, has been a source of discomfort, especially during low-light usage. Microsoft has now implemented a fix to address this problem, enhancing the dark mode experience for users.
Understanding the White Flash Issue
The white flash occurs due to the way Windows handles the creation of new application windows. When a new window is initiated, the Desktop Window Manager (DWM) assigns a default white background until the application takes over the rendering process. In dark mode, this results in a brief but jarring white flash before the browser applies its dark theme. This behavior is similar to a previously identified issue in File Explorer, which was resolved in Windows 11 version 23H2. (windowslatest.com)
Microsoft's Solution: The Cloaking Approach
To mitigate the white flash, Microsoft developer Chris Davis proposed a 'cloaking' technique within the Chromium codebase. This method involves the following steps:
- Window Cloaking: Upon creation, the new browser window is cloaked, rendering it invisible to the user.
- Background Initialization: While cloaked, the window's client area is filled with a dark background using Graphics Device Interface (GDI) calls.
- Uncloaking: Once the dark background is set, the window is uncloaked, making it visible without the initial white flash.
This approach effectively suppresses the white flash by ensuring that the window displays the appropriate dark background before becoming visible. (windowslatest.com)
Technical Details
The implementation involves modifying the INLINECODE0 file in the Chromium project. The process includes:
- Setting DWMWA_CLOAK to TRUE: This instructs Windows to cloak the newly created window.
- Applying Dark Background: GDI calls are used to paint the client area with a dark color while the window remains cloaked.
- Setting DWMWA_CLOAK to FALSE: The window is uncloaked, revealing the dark-themed interface without any white flash.
While some Chromium contributors have expressed concerns about potential race conditions—where the GPU process might finish rendering page contents simultaneously with the background update—Microsoft's internal tests have not observed such issues. (windowslatest.com)
Implications and User Impact
The resolution of the white flash issue signifies a substantial improvement in user experience for those utilizing dark mode in Edge and Chrome. By eliminating the abrupt transition from dark to white and back to dark, users can enjoy a more consistent and comfortable browsing experience, particularly in low-light environments.
This fix also underscores the collaborative efforts between Microsoft and the Chromium project to enhance browser performance and user satisfaction. The update is expected to roll out in upcoming versions of both browsers, with users encouraged to keep their software up to date to benefit from this improvement.
Conclusion
Microsoft's proactive approach to addressing the white flash issue in dark mode for Edge and Chrome demonstrates a commitment to refining user experience. Through innovative solutions like the cloaking technique, the company continues to enhance the functionality and comfort of its software offerings.