sync with war2 branch
This commit is contained in:
parent
636d133046
commit
f4375f60c4
1 changed files with 22 additions and 22 deletions
44
src/main.c
44
src/main.c
|
@ -1189,6 +1189,28 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
break;
|
||||
|
||||
//workaround for a bug where sometimes a background window steals the focus
|
||||
case WM_WINDOWPOSCHANGING:
|
||||
{
|
||||
if (ddraw->locked)
|
||||
{
|
||||
WINDOWPOS *pos = (WINDOWPOS *)lParam;
|
||||
|
||||
if (pos->flags == SWP_NOMOVE + SWP_NOSIZE)
|
||||
{
|
||||
mouse_unlock();
|
||||
|
||||
if (GetForegroundWindow() == ddraw->hWnd)
|
||||
mouse_lock();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_MOUSELEAVE:
|
||||
mouse_unlock();
|
||||
return 0;
|
||||
|
||||
case WM_ACTIVATE:
|
||||
if (wParam == WA_ACTIVE || wParam == WA_CLICKACTIVE)
|
||||
{
|
||||
|
@ -1230,28 +1252,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
return 0;
|
||||
|
||||
//workaround for a bug where sometimes a background window steals the focus
|
||||
case WM_WINDOWPOSCHANGING:
|
||||
{
|
||||
if (ddraw->locked)
|
||||
{
|
||||
WINDOWPOS *pos = (WINDOWPOS *)lParam;
|
||||
|
||||
if (pos->flags == SWP_NOMOVE + SWP_NOSIZE)
|
||||
{
|
||||
mouse_unlock();
|
||||
|
||||
if (GetForegroundWindow() == ddraw->hWnd)
|
||||
mouse_lock();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_MOUSELEAVE:
|
||||
mouse_unlock();
|
||||
return 0;
|
||||
|
||||
case WM_ACTIVATEAPP:
|
||||
/* C&C and RA stop drawing when they receive this with FALSE wParam, disable in windowed mode */
|
||||
if (ddraw->windowed || ddraw->noactivateapp)
|
||||
|
|
Loading…
Reference in a new issue