Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor windows briefly flash white upon opening #58056

Closed
FractalDiane opened this issue Feb 13, 2022 · 4 comments
Closed

Editor windows briefly flash white upon opening #58056

FractalDiane opened this issue Feb 13, 2022 · 4 comments

Comments

@FractalDiane
Copy link

FractalDiane commented Feb 13, 2022

Godot version

4.0.alpha2.official

System information

WIndows 10, Vulkan, RTX 2070 Super

Issue description

When the editor is in multi-window mode, all editor windows, such as the settings menus, are flashing white for a few frames before they appear.

This has actually been happening in every version of Godot 4 I've tried, including ones I built from source over a year ago.

ezgif.com-gif-maker.5.mp4

Steps to reproduce

  1. Make sure Godot is not in single window mode (Editor Settings->Interface->Editor->Single Window Mode).
  2. Open the Project Settings or Editor Settings and see if the window is briefly white upon appearing.

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Feb 13, 2022

I'm not sure if we have any control over this, as Godot is a Win32 application and cannot force the use of dark window borders (which I believe affects the default window background color).

This affects Godot 3.x too, but you don't notice it as much because windows are only created once for the project manager and editor (before the splash screen appears).

@TechnicalSoup
Copy link
Contributor

There is a little bit of discussion about this issue over at stackoverflow. A few people there have mentioned that a call to SetWindowPos immediately after the window creation seems to stop the white flash.

Feels like a bit of a workaround for strange behavior in the Microsoft API, but I'll give it a try in the coming days to see what effect it has.

@TechnicalSoup
Copy link
Contributor

Update on some slight progress. From experimenting with the DisplayServer code, I didn't see any real difference using some of the workarounds mentioned. However, the problem being described there was the window incorrectly painting the background color as white before the initial paint, whereas I feel as though this problem is the delay between the window being created and the first paint/render.

Looking at the code in the Windows platform DisplayServer we're not setting the background color to anything via the window class. I tested out hard coding a color in here that matched the editor interface "base" color
wc.hbrBackground = CreateSolidBrush(RGB(51, 59, 71));
and the momentary flash between window creation and first painting was much less jarring, however I'm still left hunting for the cause of the delay between the window creation and the first paint.

Interesting observations are that the separate call to ShowWindow seem redundant as by calling the CreateWindowExW method with the WS_VISIBLE flag set in the style shows the window immediately after creation. I was having trouble debugging the window paint/rendering - but it looks like the Windows message WM_PAINT sets a flag to force a redraw on the next pass through the main loop.

Also - there seemed to be a lot of unusual windows messages queued up between the window creation and the rendering that would no doubt be causing delays. On my system I was seeing a number of power broadcast messages which was quite strange.

In short - no solution as yet, but by setting a background color we can make it less obtrusive until a solution is found.

@akien-mga
Copy link
Member

Fixed by #71289.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants