Since 859b526c81a2af841b5b7b28d06f3d782bccdab5, console windows are always shown even if they're supposed to start in some other state, e.g. minimized.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
This fixes the regression.
programs/conhost/conhost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index e3a9a25..24a9397 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -2756,7 +2756,8 @@ int __cdecl wmain(int argc, WCHAR *argv[]) if (!init_window( &console )) return 1; GetStartupInfoW( &si ); set_console_title( &console, si.lpTitle, wcslen( si.lpTitle ) * sizeof(WCHAR) ); - ShowWindow( console.win, SW_SHOW ); + ShowWindow( console.win, (si.dwFlags & STARTF_USESHOWWINDOW) && si.wShowWindow != SW_SHOWDEFAULT + ? si.wShowWindow : SW_SHOW ); }
return main_loop( &console, signal );
Gabriel Ivăncescu gabrielopcode@gmail.com wrote:
ShowWindow( console.win, SW_SHOW );
ShowWindow( console.win, (si.dwFlags & STARTF_USESHOWWINDOW) && si.wShowWindow != SW_SHOWDEFAULT
? si.wShowWindow : SW_SHOW );
What's the reason to treat SW_SHOWDEFAULT specially?
On 30/11/2020 18:19, Dmitry Timoshkov wrote:
Gabriel Ivăncescu gabrielopcode@gmail.com wrote:
ShowWindow( console.win, SW_SHOW );
ShowWindow( console.win, (si.dwFlags & STARTF_USESHOWWINDOW) && si.wShowWindow != SW_SHOWDEFAULT
? si.wShowWindow : SW_SHOW );
What's the reason to treat SW_SHOWDEFAULT specially?
I initially tried just setting it to SW_SHOWDEFAULT without any checks, and it didn't work. I was assuming the SW_SHOW was there for a reason in such case, as the "default". I'm not that familiar with how this works, so of course I can remove it if it's actually unnecessary.
Gabriel Ivăncescu gabrielopcode@gmail.com wrote:
ShowWindow( console.win, SW_SHOW );
ShowWindow( console.win, (si.dwFlags & STARTF_USESHOWWINDOW) && si.wShowWindow != SW_SHOWDEFAULT
? si.wShowWindow : SW_SHOW );
What's the reason to treat SW_SHOWDEFAULT specially?
I initially tried just setting it to SW_SHOWDEFAULT without any checks, and it didn't work. I was assuming the SW_SHOW was there for a reason in such case, as the "default". I'm not that familiar with how this works, so of course I can remove it if it's actually unnecessary.
If there's no real reason then please remove it.