microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.57k stars 29.01k forks source link

[theme] avoid flashing when starting up with a new OS color scheme #191307

Open vaibhavshn opened 1 year ago

vaibhavshn commented 1 year ago

Type: Bug

When I have light and dark mode themes configured and have a default theme which is light in my config, and I turn on dark mode in my system (macOS), and then start VS code, I see the default theme which is light flash before turning black. Ideal behaviour would be no flash of default theme when starting up.

Duplicate of https://github.com/microsoft/vscode/issues/95190.

Edit: reopened as the previous issue was locked.

VS Code version: Code 1.81.1 (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:40:25.698Z) OS version: Darwin arm64 23.0.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M1 (8 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|4, 2, 2| |Memory (System)|16.00GB (0.04GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (12) Extension|Author (truncated)|Version ---|---|--- astro-vscode|ast|2.3.0 vscode-tailwindcss|bra|0.9.13 vscode-eslint|dba|2.4.2 gitlens|eam|14.2.1 prettier-vscode|esb|10.1.0 figma-vscode-extension|fig|0.2.7 fluent-icons|mig|0.0.18 vscode-filesize|mkx|3.1.0 color-highlight|nau|2.5.0 vscode-mdx|uni|1.4.0 errorlens|use|3.13.0 vim|vsc|1.25.2
aeschli commented 1 year ago

Themes come with theme files, and we need to load them. As we can only do this once the extension host is up and loading can take a while, we show the colors that we had on shutdown. That's why you see the flashing.

The fix would be to cache the preferred light/dark themes as well.