Repository navigation
A hypothetical fix for hidden windows - #15213
Conversation
We had a report in a mail thread that someone's Terminal windows were getting created hidden, and never showing themselves. As a theory, I'm guessing that dwFlags didn't say that we should actually use `wShowWindow`. So, to be more correct, let's actually obey that. I'm gonna send this package to them to see if it fixes them. Related to #14957. Likely regressed in #13838.
|
Do you want to wait for validation before reviews or merge? |
| STARTUPINFOW si; | ||
| GetStartupInfoW(&si); | ||
| const auto showWindow = si.wShowWindow; | ||
| const uint32_t showWindow = WI_IsFlagSet(si.dwFlags, STARTF_USESHOWWINDOW) ? si.wShowWindow : SW_SHOW; |
There was a problem hiding this comment.
we may want to prefer SW_SHOWDEFAULT. FYI, SW_SHOWDEFAULT actually.. wait
wait
SW_SHOWDEFAULT is supposed to do this entire thing (check the flag, use wShowWindow if it's set, etc.)
There was a problem hiding this comment.
now i'm curious, why was SHOWDEFAULT not working?
There was a problem hiding this comment.
Presumably, because we'd collect the wShowWindow here, and eventually plumb it into the ShowWindow call in AppHost::_WindowInitializedHandler, regardless of what the actual dwFlags said. So if the wShowWindow was set to 0, then we'd hide the window even if the flags didn't call for it
There was a problem hiding this comment.
Actually, I've got a couple other questions about this whole kit and/or kaboodle.
So, okay. This happens when a commandline comes in.
Can you walk me through what happens in these scenarios?
- Terminal is not running, and you run
wt - Terminal is not running, and you run
start /min wt - Terminal is running, and you run
wt - Terminal is running, and you run
start /min wt - Terminal is running in Attach to most recent window mode, and you run
start /min wt
There was a problem hiding this comment.
i.e. whose nShowCmd/wShowWindow are we using? The one from the receiving process, or the sending process?
- Terminal is not running, and you run
start /min wt, and then you runstart /max wt -w -1or juststart wt -w -1- Would the new window get the incoming
wShowWindow, or would it get the one of the original WT instance started with/min?
- Would the new window get the incoming
There was a problem hiding this comment.
- Terminal boots. Looks at its combined
si.dwFlagsandsi.wShowWindow, sticks that into theRemoting::CommandlineArgs. That's given to theAppHost, who uses that in the post-init call toShowWindow(unlesslaunchModeis set to*maximized*) - Same deal as 1. Here,
si.dwFlags+si.wShowWindow-->SW_SHOWMINIMIZED - Terminal boots. Looks at its combined
si.dwFlagsandsi.wShowWindow, sticks that into theRemoting::CommandlineArgs. Those get remoted to the monarch. They hand them off to theAppHostcreated for this window. ThatAppHost, uses that in the post-init call toShowWindow, just like in 1. - Same deal. We just remote
SW_SHOWMINIMIZEDto the monarch who gives that to the eventual window that gets created - Terminal boots. Looks at its combined
si.dwFlagsandsi.wShowWindow. FindsSW_SHOWMINIMIZED. Sticks that in theCommandlineArgs.ProposeCommandline's that to the Monarch, who passes it to an existing window. That existing window finds a commandline of"wt". Treats that as anew-tabsubcommand. A new tab is opened. The state of the window is unaffected. - Same as 2 ; and then we remote a
SW_MAXIMIZEin theCommandlineArgsfor the new window, and create a second window with a different state.- yes, the new window gets the startupinfo from the process that initiated the creation of this window.
Sound right?
|
I'm building a Release signed msix for our internal friend to try out, but Leonard's comment is promising |
Dustin L. Howett (DHowett)
left a comment
There was a problem hiding this comment.
VER I FIED
We had a report in a mail thread that someone's Terminal windows were getting created hidden, and never showing themselves.
As a theory, I'm guessing that dwFlags didn't say that we should actually use
wShowWindow. So, to be more correct, let's actually obey that.I'm gonna send this package to them to see if it fixes them.
Related to #14957.
Likely regressed in #13838.