-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore the ability for alt+tab to restore the Terminal after minimizing with taskbar #13624
Conversation
…ing with taskbar Curiously, at least on Windows 10 (and rarely on Windows 11), if you minimize the Terminal by clicking on the taskbar, then alt-tab to try and restore the window, the Taskbar will decide to call `SwitchToWindow` on the invisible, owned ConPTY window instead of the main window. When that happens, ConPTY'll get a `WM_SIZE(SIZE_RESTORED, lParam=0)`. The main window will NOT get a `SwitchToWindow` called. If ConPTY doesn't actually inform the hosting process about this, then the main HWND might stay hidden. * Refer to #13158 where we disabled this. * Closes #13589 * **TODO** Does this also address #13248 * Tested manually on a Windows 10 VM. * Confirmed that opening tabs while maximized/snapped doesn't restore down. * `[Native]::ShowWindow([Native]::GetConsoleWindow(), 6)` still works
…nal after minimizing with taskbar
This comment was marked as off-topic.
This comment was marked as off-topic.
// | ||
// ONLY "restore" if already minimized. If the window is maximized or | ||
// snapped, a restore will restore-down the window instead. | ||
if (showOrHide == true && ::IsIconic(hwnd)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. So the only difference here is the IsIconic()
check. Got it.
Don't forget to tag this up as servicing. Idk which versions this needs to be cherry-picked to? |
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
…ing with taskbar (#13624) Curiously, at least on Windows 10 (and rarely on Windows 11), if you minimize the Terminal by clicking on the taskbar, then alt-tab to try and restore the window, the Taskbar will decide to call `SwitchToWindow` on the invisible, owned ConPTY window instead of the main window. When that happens, ConPTY'll get a `WM_SIZE(SIZE_RESTORED, lParam=0)`. The main window will NOT get a `SwitchToWindow` called. If ConPTY doesn't actually inform the hosting process about this, then the main HWND might stay hidden. * Refer to #13158 where we disabled this. * Closes #13589 * Closes #13248 * Tested manually on a Windows 10 VM. * Confirmed that opening tabs while maximized/snapped doesn't restore down. * `[Native]::ShowWindow([Native]::GetConsoleWindow(), 6)` still works (cherry picked from commit d1fc112) Service-Card-Id: 84673887 Service-Version: 1.15
🎉 Handy links: |
🎉 Handy links: |
…ing with taskbar (microsoft#13624) Curiously, at least on Windows 10 (and rarely on Windows 11), if you minimize the Terminal by clicking on the taskbar, then alt-tab to try and restore the window, the Taskbar will decide to call `SwitchToWindow` on the invisible, owned ConPTY window instead of the main window. When that happens, ConPTY'll get a `WM_SIZE(SIZE_RESTORED, lParam=0)`. The main window will NOT get a `SwitchToWindow` called. If ConPTY doesn't actually inform the hosting process about this, then the main HWND might stay hidden. * Refer to microsoft#13158 where we disabled this. * Closes microsoft#13589 * Closes microsoft#13248 * Tested manually on a Windows 10 VM. * Confirmed that opening tabs while maximized/snapped doesn't restore down. * `[Native]::ShowWindow([Native]::GetConsoleWindow(), 6)` still works (cherry picked from commit d1fc112) Service-Card-Id: 84673887 Service-Version: 1.15 (cherry picked from commit b670800) Service-Card-Id: 84673886 Service-Version: 1.14
Curiously, at least on Windows 10 (and rarely on Windows 11), if you minimize the Terminal by clicking on the taskbar, then alt-tab to try and restore the window, the Taskbar will decide to call
SwitchToWindow
on the invisible, owned ConPTY window instead of the main window. When that happens, ConPTY'll get aWM_SIZE(SIZE_RESTORED, lParam=0)
. The main window will NOT get aSwitchToWindow
called. If ConPTY doesn't actually inform the hosting process about this, then the main HWND might stay hidden.[Native]::ShowWindow([Native]::GetConsoleWindow(), 6)
still works