Skip to content
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

Fix two ConPTY HWND focus issues #17828

Merged
merged 6 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/cascadia/WindowsTerminal/IslandWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,15 @@ long IslandWindow::_calculateTotalSize(const bool isWidth, const long clientSize
_HandleCreateWindow(wparam, lparam);
return 0;
}
case WM_ENABLE:
{
if (_interopWindowHandle != nullptr)
{
// send focus to the child window
SetFocus(_interopWindowHandle);
}
break;
}
case WM_SETFOCUS:
{
if (_interopWindowHandle != nullptr)
Expand Down
10 changes: 10 additions & 0 deletions src/interactivity/base/InteractivityFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ using namespace Microsoft::Console::Interactivity;
{
_WritePseudoWindowCallback((bool)wParam);
}
return 0;
}
case WM_GETOBJECT:
{
Expand All @@ -476,6 +477,15 @@ using namespace Microsoft::Console::Interactivity;
}
return 0;
}
case WM_ACTIVATE:
{
if (const auto ownerHwnd{ ::GetAncestor(hWnd, GA_ROOTOWNER) })
{
SetFocus(ownerHwnd);
return 0;
}
break;
}
}
// If we get this far, call the default window proc
return DefWindowProcW(hWnd, Message, wParam, lParam);
Expand Down
Loading