terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Starting WT momentarily shows a black titlebar

Open rashil2000 opened this issue 3 years ago • 10 comments

Windows Terminal version (or Windows build number)

10.0.19043.1288 1.12.2922.0

Other Software

No response

Steps to reproduce

Start WT.

Expected Behavior

The GUI should start without showing a glitched black title bar, just as it did in v1.11.

Actual Behavior

It shows a black title bar for a few milliseconds. See below:

2

1

My settings.json is the same as before I upgraded (through Store).

rashil2000 avatar Oct 21 '21 08:10 rashil2000

showerthought: we could have a solid BG for the TerminalPage until initialization is completed, and then drop out the bg. That might obscure the titlebar until the rest of the content initializes.

zadjii-msft avatar Oct 21 '21 13:10 zadjii-msft

Note to self - that didn't work. Might need to do this higher up in Win32 land. Might need to actually start with the window painted with some color, then paint it all with BLACK_BRUSH

You also can't just hack this by immediately creating the window without WS_EX_NOREDIRECTIONBITMAP and then later turning that style on. You have to create the window with WS_EX_NOREDIRECTIONBITMAP, SetWindowLong won't work. see:

  • https://stackoverflow.com/questions/40576394/setwindowlong-with-gwl-exstyle-and-ws-ex-noredirectionbitmap

zadjii-msft avatar Oct 25 '21 19:10 zadjii-msft

This was something that I noticed with the upgrade to WinUI 2.7, in case that gives any help.

Rosefield avatar Oct 25 '21 22:10 Rosefield

I suspect that this is more due to the changes we made to drop out the back of the window in #11180

DHowett avatar Oct 25 '21 22:10 DHowett

Yea, this was definitely regressed in #11180. I've spent enough time on this for this week, but made no real progress. I don't think we can just draw the BG manually in WM_ERASEBKGND or something, because there is not GDI redirection surface to draw to. my current crazy idea is using CreateSwapChainForHwnd to create a swapchain for the hwnd, draw the color to that, then make it transparent once the Island is initialized. Not sure I have time to futz with that now though. DirectComposition might be an easier way, but this tutorial looks... long and maybe more complicated than we need. maybe next DoL.

What we really need is someone who actually understands user32 to come give us an assist on this one.

zadjii-msft avatar Oct 28 '21 16:10 zadjii-msft

Some gifs recorded this morning of the issue. No progress to report.

transparent-frame-on-launch-000 transparent-frame-resizing-000

zadjii-msft avatar Nov 17 '21 16:11 zadjii-msft

Note to self: maybe we can DWM_CLOAK the window until it's initialized

zadjii-msft avatar Apr 18 '22 10:04 zadjii-msft

note to self: tried just setting a BG for the TerminalPage then yanking that after we're initialized. There's still a few frames before the XAML content loads at all. I'd say the cloaking thing felt more polished comparatively.

zadjii-msft avatar Apr 21 '22 12:04 zadjii-msft

Whoops, we reverted this and never reopened

zadjii-msft avatar Jul 25 '22 15:07 zadjii-msft

From teams:

This is the "empty terminal" animating in thing I mentioned

you likely want to hookup a solid color brush via DComp/WinComp that paints everything some opaque color to avoid this

your swapchain effectively "does not exist" until the first present is finished so this is why you get this behavior

zadjii-msft avatar Sep 02 '22 11:09 zadjii-msft