Skip to content

[Windows] White flash on start up #428

@Conrad33

Description

@Conrad33

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions