This fixes the flashing. However...

This does not fix doing a `[Native]::ShowWindow([Native]::GetConsoleWindow(), 0)` (0==`SW_HIDE`) immediately in a Terminal window. Presumably, this is because the conpty window already has that bit set?
This commit is contained in:
Mike Griese
2022-05-17 06:16:13 -05:00
parent 9525bebcab
commit bbae2355cc
2 changed files with 12 additions and 4 deletions

View File

@@ -2430,8 +2430,11 @@ namespace winrt::TerminalApp::implementation
// TermControl will copy the settings out of the settings passed to it.
TermControl term{ settings.DefaultSettings(), settings.UnfocusedSettings(), connection };
// GH#12515: ConPTY assumes it's hidden at the start. If we're not, let it know now.
term.WindowVisibilityChanged(_visible);
// // GH#12515: ConPTY assumes it's hidden at the start. If we're not, let it know now.
// if (_visible)
// {
// term.WindowVisibilityChanged(_visible);
// }
if (_hostingHwnd.has_value())
{

View File

@@ -311,13 +311,18 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
THROW_IF_FAILED(_CreatePseudoConsoleAndPipes(dimensions, flags, &_inPipe, &_outPipe, &_hPC));
// GH#12515: The conpty assumes it's hidden at the start. If we're visible, let it know now.
THROW_IF_FAILED(ConptyShowHidePseudoConsole(_hPC.get(), _initialVisibility));
if (_initialParentHwnd != 0)
{
THROW_IF_FAILED(ConptyReparentPseudoConsole(_hPC.get(), reinterpret_cast<HWND>(_initialParentHwnd)));
}
// GH#12515: The conpty assumes it's hidden at the start. If we're visible, let it know now.
// if (_initialVisibility)
// {
// THROW_IF_FAILED(ConptyShowHidePseudoConsole(_hPC.get(), _initialVisibility));
// }
// THROW_IF_FAILED(ConptyShowHidePseudoConsole(_hPC.get(), _initialVisibility));
THROW_IF_FAILED(_LaunchAttachedClient());
}
// But if it was an inbound handoff... attempt to synchronize the size of it with what our connection