window_manager
window_manager copied to clipboard
[Windows] White flash on start up
When the app is launched, the window flashes white before the color from windowManager.setBackgroundColor is applied.
I found setting then window color in windows/runner/main.cpp fixes this.
On line 36 of main.cpp i added:
// Set the background color of the window flutter grey.shade900 to prevent flash white on startup.
HBRUSH hBrush = CreateSolidBrush(RGB(0x21, 0x21, 0x21));
SetClassLongPtr(window.GetHandle(), GCLP_HBRBACKGROUND, reinterpret_cast<LONG_PTR>(hBrush));
I used chat gpt to generate these two lines so I'm not sure if this is a sensible way of doing it.