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

fix cursor lock on alt+tab

This commit is contained in:
FunkyFr3sh 2021-11-27 17:38:22 +01:00
parent a71528f35f
commit 6a38496bf7
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

@ -504,6 +504,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();
}
}