Starting WT momentarily shows a black titlebar #15617

Closed
opened 2026-01-31 04:43:35 +00:00 by claunia · 10 comments
Owner

Originally created by @rashil2000 on GitHub (Oct 21, 2021).

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).

Originally created by @rashil2000 on GitHub (Oct 21, 2021). ### 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](https://user-images.githubusercontent.com/46838874/138241520-f668f835-239c-45d9-a11d-409b016137c3.gif) ![1](https://user-images.githubusercontent.com/46838874/138241542-a7ec130a-2087-47e6-b34f-2f09a6642243.gif) My [settings.json](https://github.com/rashil2000/dotfiles/blob/master/wt/settings.json) is the same as before I upgraded (through Store).
Author
Owner

@zadjii-msft commented on GitHub (Oct 21, 2021):

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 commented on GitHub (Oct 21, 2021): 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.
Author
Owner

@zadjii-msft commented on GitHub (Oct 25, 2021):

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:

@zadjii-msft commented on GitHub (Oct 25, 2021): 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
Author
Owner

@Rosefield commented on GitHub (Oct 25, 2021):

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

@Rosefield commented on GitHub (Oct 25, 2021): This was something that I noticed with the upgrade to WinUI 2.7, in case that gives any help.
Author
Owner

@DHowett commented on GitHub (Oct 25, 2021):

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

@DHowett commented on GitHub (Oct 25, 2021): I suspect that this is more due to the changes we made to drop out the back of the window in #11180
Author
Owner

@zadjii-msft commented on GitHub (Oct 28, 2021):

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 commented on GitHub (Oct 28, 2021): 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](https://docs.microsoft.com/en-us/windows/win32/directcomp/initialize-directcomposition) 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.
Author
Owner

@zadjii-msft commented on GitHub (Nov 17, 2021):

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

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

@zadjii-msft commented on GitHub (Nov 17, 2021): Some gifs recorded this morning of the issue. No progress to report. ![transparent-frame-on-launch-000](https://user-images.githubusercontent.com/18356694/142231718-05b95699-ea9b-4212-bb87-b2f690e368da.gif) ![transparent-frame-resizing-000](https://user-images.githubusercontent.com/18356694/142232692-2882b083-3142-405b-9323-e07e803dc893.gif)
Author
Owner

@zadjii-msft commented on GitHub (Apr 18, 2022):

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

@zadjii-msft commented on GitHub (Apr 18, 2022): Note to self: maybe we can DWM_CLOAK the window until it's initialized
Author
Owner

@zadjii-msft commented on GitHub (Apr 21, 2022):

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 commented on GitHub (Apr 21, 2022): 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.
Author
Owner

@zadjii-msft commented on GitHub (Jul 25, 2022):

Whoops, we reverted this and never reopened

@zadjii-msft commented on GitHub (Jul 25, 2022): Whoops, we reverted this and never reopened
Author
Owner

@zadjii-msft commented on GitHub (Sep 2, 2022):

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 commented on GitHub (Sep 2, 2022): 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15617