1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 14:14:47 +01:00

fix cursor lock on alt+tab

(cherry picked from commit 6a38496bf76fea3a84087a9a3fd66d2911900fa1)
This commit is contained in:
FunkyFr3sh 2021-11-27 17:38:22 +01:00
parent 4a0d74001a
commit aca2ca7071
2 changed files with 2 additions and 1 deletions

View File

@ -13,7 +13,7 @@ void mouse_lock()
if (g_ddraw->devmode || g_ddraw->bnet_active)
return;
if (g_hook_active && !g_ddraw->locked)
if (g_hook_active && !g_ddraw->locked && !IsIconic(g_ddraw->hwnd))
{
int game_count = InterlockedExchangeAdd((LONG*)&g_ddraw->show_cursor_count, 0);
int cur_count = real_ShowCursor(TRUE) - 1;

View File

@ -500,6 +500,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
if (g_ddraw->renderer != d3d9_render_main)
{
ChangeDisplaySettings(&g_ddraw->render.mode, CDS_FULLSCREEN);
real_ShowWindow(g_ddraw->hwnd, SW_RESTORE);
mouse_lock();
}
}