* Warzone seems to hang when loosing focus (gets stuck into an infinite loop somewhere) on Windows

* Fix this by ignoring focus loss on Windows

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1603 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2007-05-10 08:21:42 +00:00
parent f347fa4fa8
commit b8a986228b
1 changed files with 10 additions and 0 deletions

View File

@ -53,6 +53,12 @@
#include "SDL_framerate.h"
// Define IGNORE_FOCUS when you wish to make warzone ignore loss of focus.
// On Windows this is currently required in order to prevent Warzone from hanging. -- Giel
#ifdef WZ_OS_WIN
# define IGNORE_FOCUS
#endif
/* Linux specific stuff */
static FPSmanager wzFPSmanager;
@ -187,20 +193,24 @@ static void processEvent(SDL_Event *event)
if (event->active.gain == 1)
{
debug( LOG_NEVER, "WM_SETFOCUS\n");
#ifndef IGNORE_FOCUS
if (focusState != FOCUS_IN)
{
debug( LOG_NEVER, "FOCUS_SET\n");
focusState = FOCUS_SET;
}
#endif
}
else
{
debug( LOG_NEVER, "WM_KILLFOCUS\n");
#ifndef IGNORE_FOCUS
if (focusState != FOCUS_OUT)
{
debug( LOG_NEVER, "FOCUS_KILL\n");
focusState = FOCUS_KILL;
}
#endif
/* Have to tell the input system that we've lost focus */
inputLooseFocus();
}