White flash when opening a new window maximized or fullscreen
Does this issue occur when all extensions are disabled?: Yes
Version: 1.60.0 (user setup) Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff Date: 2021-09-01T10:41:52.311Z Electron: 13.1.8 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.19043
Steps to Reproduce:
- Set "Window: New Window Dimensions" to "maximized" or "fullscreen"
- From an existing instance of vscode, open a new instance
The issue was reported here and closed because Electron 8 apparently fixed the issue. However, I'm still having this issue with Electron 13 on Windows. The issue is not present on Manjaro.
/gifPlease
Thanks for reporting this issue! Unfortunately, it's hard for us to understand what issue you're seeing. Please help us out by providing a screen recording showing exactly what isn't working as expected. While we can work with most standard formats, .gif files are preferred as they are displayed inline on GitHub. You may find https://gifcap.dev helpful as a browser-based gif recording tool.
If the issue depends on keyboard input, you can help us by enabling screencast mode for the recording (Developer: Toggle Screencast Mode in the command palette).
Happy coding!

Are you running via WSL ? Does the issue repro if you launch with code --disable-gpu ?
I don't normally use WSL to launch. That is just a gif I found on a previous issue that was similar, but that issue had a different cause and fix. The white flash looks the exact same to me. It occurs when I launch from the Windows GUI, from CMD, or from WSL.
I only have a dedicated graphics card and no integrated graphics on my Ryzen CPU, so I wouldn't expect anything different to happen. I have tried code --disable-gpu in CMD and WSL and I still have the white flash.
Can you provide a screen capture from your device showing the exact steps of launch ? Also attach the output of code --verbose
Like I said, it happens when launching from the terminal or from the GUI. It looks exactly like the GIF, and the flash of white is the exact same. I could record 7 different gifs, one from the launching in taskbar, one from the start menu, one from a desktop icon, a new window from VSCode, from CMD, Powershell, and WSL. It all results in the same thing.
The important step is that it first opens maximized or fullscreen on the Windows operating system.
[main 2021-09-09T03:32:20.601Z] Sending some foreground love to the running instance: 3180 [main 2021-09-09T03:32:20.606Z] Sending env to running instance... [main 2021-09-09T03:32:20.728Z] Sent env to running instance. Terminating... [main 2021-09-09T03:32:20.728Z] Lifecycle#kill()
I could record 7 different gifs, one from the launching in taskbar, one from the start menu, one from a desktop icon, a new window from VSCode, from CMD, Powershell, and WSL.
Yes it is fine, please attach a recording of what you are observing.
As for the code --verbose output, looks like you are already having a running instance. Please close all running instances and run that command.
Here's the log file for opening the first instance, although it's a bit cluttered because of extensions and workspaces. I have already reproduced the error without extensions on a new install of VSCode Insiders, so extensions, themes, and workspaces are irrelevant. output.txt
Were you able to reproduce the issue? I couldn't get the screencast website you shared to work. Anyway, this makes no difference.
I can reproduce this
Version: 1.63.0-insider (user setup)
Commit: d18d093403b12a65350c58a7b0d5771cc1f42aba
Date: 2021-11-26T08:21:30.810Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043
https://user-images.githubusercontent.com/1330321/143835118-5232eecc-d285-446c-a2e1-3563f63e71fc.mp4
I've started getting this recently. Like 3-4 builds ago along with another more annoying issue - when VS code touches the bottom of the screen (even not maximized) it prevents the taskbar from showing up when I move the mouse to the bottom.
Upstream issue: https://github.com/electron/electron/issues/35362
Chromium gets the message handler to show a window before the content window. The window that the message handler shows has a white background.
I notice that if I edit Chromium's OnPaint handler, I can get it to paint a black background by moving a line that calls FillRect out of the if statement so that it always runs. This is more a proof of concept rather than an actual fix for the issue.
However, even with that fix, there is still a flash of white at the beginning. That flash might be a Windows bug. Therefore, assuming I get to merge in a fix into Electron for this issue, the fix would shorten the length of the white background, rather than completely eliminate it.
The bug still persists on Windows 11
The video submitted by RobbyCBennett replicates exactly what I'm seeing on a fresh install of Ubuntu 22.04 with a clean install of code.
| CPUs | Intel(R) Core(TM) i5-1035G4 CPU @ 1.10GHz (8 x 1500) |
|---|---|
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: disabled_software video_encode: disabled_software vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: disabled_off |
| Load (avg) | 0, 1, 1 |
| Memory (System) | 7.36GB (4.81GB free) |
| Process Argv | --unity-launch |
| Screen Reader | no |
| VM | 0% |
I have noticed that the issue is not currently present on Windows 11, but it is still present on Windows 10. I have made sure that VS Code is updated on both machines.
Yes, definitely still present on Win 10 / latest insiders. Ms Edge and Chrome suffer from the same issue, btw.
On Windows 11, I'm seeing the issue again for the latest release.
Version: 1.77.0 (system setup) Commit: 7f329fe6c66b0f86ae1574c2911b681ad5a45d63 Date: 2023-03-29T10:02:16.981Z Electron: 19.1.11 Chromium: 102.0.5005.196 Node.js: 16.14.2 V8: 10.2.154.26-electron.0 OS: Windows_NT x64 10.0.22621 Sandboxed: No
I also see this issue using Ubuntu 22.04.3 LTS, and VS Code 1.83.0
It happens when I run code --disable-gpu --disable-extensions
As further information, it displays this white flash whenever I switch to the desktop workspace on which VS Code is running.
Happy to provide further information, if someone tells me what is needed and how to provide it.
If anyone knows a temporary work around for this, of any sort, that would be much appreciated, because having it flash every time one switches to the window is really frustrating.
I've just tried this on a Windows 10 system that has an integrated GPU and a dedicated GPU and this time I noticed a difference between the two. Here are my results.
- Dedicated GPU (
code --disable-extensions): the white flash is longer. - Integrated GPU (
code --disable-gpu --disable-extensions): the white flash is shorter. The 2nd time out of 3 times I ran this command, I didn't even notice a white flash.
https://github.com/microsoft/vscode/assets/22121365/2b0c2ac4-e00c-4aa5-a8a1-b471b4e2ffe8
Based on https://github.com/microsoft/vscode/issues/132339#issuecomment-1246051350 and given we don't have a clear path to upstream the changes to chromium, closing as not actionable.
I am also experiencing this on Windows 11. Pretty minimal install
I had the thought to force it to not open maximized and see if it fixed it, because when the window was not maximized there was no flash at all.
workbench.panel.opensMaximized: always -> never
However Windows 11 seems to completely disregard this and open maximized anyway, so, bright white flash
I found a fix or say workaround for this white flash issue when opening maximized VS Code, had to experiment with various values. I found that VS Code makes a delay on purpose when vscode is maximized or in fullscreen mode. This is to wait until vscode window is fully loaded and then show it. While waiting, it makes default white flash which is an electron default mechanism. White Flash Fix:
- Open C:\Users<UserName>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\main.js
- Search for "show:"
- Replace line "show:e.mode!==0&&e.mode!==3" with "show:true,".
- Save & Exit. This will remove the delay and instantly loads the window which avoids white flash of electron.
Thanks. That workaround works for me. Here's the location in source.
https://github.com/microsoft/vscode/blob/966a672107ce33bcc65a413f984254bab492a70e/src/vs/platform/windows/electron-main/windows.ts#L140
@deepak1556 any idea why show: false gives us white background flicker while show: true does not?
We know from previous investigation that the white background is from the window drawn by the message handler https://source.chromium.org/chromium/chromium/src/+/main:ui/gfx/win/window_impl.cc;l=218-220 , this window is not hidden in both show: false and show: true cases. It could only be that when drawing content window together with this message handling window it gets put behind the content window and we don't see the flash. We can attempt to hide the message handling window initially and see how that works.
@deepak1556 so this is a different window than the one VS Code gets to be rendered in and with show: false it becomes initially briefly visible, while with show: true our window wins?
yup that is correct
This bug has been fixed in the latest release of VS Code Insiders!
@RobbyCBennett, you can help us out by commenting /verified if things are now working as expected.
If things still don't seem right, please ensure you're on version 496ebc4723371f29c9ffa0319dcccb2d7bee7ee0 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.
Happy Coding!
I still get the white flash on https://github.com/microsoft/vscode/commit/496ebc4723371f29c9ffa0319dcccb2d7bee7ee0 using Windows 10 22H2 19045.5854 (Have not checked any other OS).