Solved it by changing Core.cpp
case WM_ACTIVATE:
{
// if being made inactive and currently we are topmost temporarily remove topmost until we are active again.
if (LOWORD(wParam) != WA_INACTIVE)
{
if (g_bShouldBeTopMost) ::SetWindowPos(g_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSENDCHANGING | SWP_NOSIZE);
agk::Resumed();
}
else
{
agk::MouseLeftButton(0, 0);
agk::MouseRightButton(0, 0);
agk::MouseMiddleButton(0, 0);
if (g_bShouldBeTopMost) ::SetWindowPos(g_hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSENDCHANGING | SWP_NOSIZE);
// ataribaby - clear all key states when inactive to prevent stuck keys
for (size_t i = 0; i < 256; i++)
{
if (agk::GetRawKeyState(i))
{
agk::KeyUp(i);
}
}
}
agk::WindowMoved();
return DefWindowProc(hWnd, message, wParam, lParam);
}