Compare commits

...

1 Commits

Author SHA1 Message Date
Mike Griese
55bdee26a5 This is another idea for #13388 that I don't actually think will work
I'm not sure there's anything about this that is any different from attempt-1,
  to be honest. I don't thing the GetActiveWindow check will really find the
  Terminal. Useless.
2023-01-18 14:37:25 -06:00

View File

@@ -476,6 +476,29 @@ using namespace Microsoft::Console::Interactivity;
}
return 0;
}
case WM_ACTIVATE:
{
// Get the top-level HWND hosting us
if (const auto ownerHwnd{ ::GetAncestor(hWnd, GA_ROOTOWNER) })
{
// If we were activated....
if (LOWORD(wParam) != WA_INACTIVE)
{
// And the currently active HWND was our owner
if (ownerHwnd == GetActiveWindow())
{
// Just toss the focus back
SetActiveWindow(ownerHwnd);
}
}
}
}
case WM_MOUSEACTIVATE:
{
// This was another thing that was considered. This _should_ help
// prevent activations of certain kinds.
return MA_NOACTIVATEANDEAT;
}
}
// If we get this far, call the default window proc
return DefWindowProcW(hWnd, Message, wParam, lParam);