From 778e4635495104fe023c5d2c3d23e25cbf7f4c77 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 17 May 2012 17:19:52 +0000 Subject: [PATCH] "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 --- polymer/eduke32/build/src/winlayer.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index d3cce8207..6c8aa6ff3 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -829,7 +829,8 @@ int32_t handleevents(void) if (startwin_idle((void *)&msg) > 0) continue; TranslateMessage(&msg); - DispatchMessage(&msg); +// DispatchMessage(&msg); + DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam); } 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; break; - case WM_ACTIVATEAPP: + case WM_ACTIVATE: { - appactive = (wParam != 0); + appactive = (LOWORD(wParam) != 0); #ifdef USE_OPENGL if (hGLWindow) { @@ -3730,28 +3731,9 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA Bmemset(keystatus, 0, sizeof(keystatus)); 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: // someone stole the palette so try and steal it back if (bDDrawInited && bpp == 8 && fullscreen)