"Band-aid" fix for the issue with EDuke32 and Mapster32 visually locking up but continuing to run and play sounds after alt+tabbing away for a few seconds on Windows Vista/7. This may screw something else up, so please test thoroughly.

git-svn-id: https://svn.eduke32.com/eduke32@2657 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2012-05-17 17:19:52 +00:00
parent 2ca8dc1c38
commit 778e463549

View file

@ -829,7 +829,8 @@ int32_t handleevents(void)
if (startwin_idle((void *)&msg) > 0) continue; if (startwin_idle((void *)&msg) > 0) continue;
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); // DispatchMessage(&msg);
DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam);
} }
if (!appactive || quitevent) rv = -1; if (!appactive || quitevent) rv = -1;
@ -3683,9 +3684,9 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
if (wParam == SC_KEYMENU || wParam == SC_HOTKEY) return 0; if (wParam == SC_KEYMENU || wParam == SC_HOTKEY) return 0;
break; break;
case WM_ACTIVATEAPP: case WM_ACTIVATE:
{ {
appactive = (wParam != 0); appactive = (LOWORD(wParam) != 0);
#ifdef USE_OPENGL #ifdef USE_OPENGL
if (hGLWindow) if (hGLWindow)
{ {
@ -3730,28 +3731,9 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
Bmemset(keystatus, 0, sizeof(keystatus)); Bmemset(keystatus, 0, sizeof(keystatus));
AcquireInputDevices(appactive); AcquireInputDevices(appactive);
break; return 0;
} }
case WM_ACTIVATE:
appactive = (wParam != WA_INACTIVE);
if (appactive)
{
SetForegroundWindow(hWindow);
SetFocus(hWindow);
}
Bmemset(keystatus, 0, sizeof(keystatus));
AcquireInputDevices(appactive);
break;
case WM_SIZE:
if (wParam == SIZE_MAXHIDE || wParam == SIZE_MINIMIZED) appactive = 0;
else appactive = 1;
AcquireInputDevices(appactive);
break;
case WM_PALETTECHANGED: case WM_PALETTECHANGED:
// someone stole the palette so try and steal it back // someone stole the palette so try and steal it back
if (bDDrawInited && bpp == 8 && fullscreen) if (bDDrawInited && bpp == 8 && fullscreen)