fix up focus
This commit is contained in:
@@ -488,15 +488,24 @@ static void GameLoop()
|
|||||||
DISPLAY->ResolutionChanged(event.resize.w, event.resize.h);
|
DISPLAY->ResolutionChanged(event.resize.w, event.resize.h);
|
||||||
break;
|
break;
|
||||||
case SDL_ACTIVEEVENT:
|
case SDL_ACTIVEEVENT:
|
||||||
g_bHasFocus = !!event.active.gain;
|
{
|
||||||
LOG->Trace("App %s focus", g_bHasFocus? "has":"doesn't have");
|
/* We don't care about mouse focus. */
|
||||||
|
if(event.active.state == SDL_APPMOUSEFOCUS)
|
||||||
|
break;
|
||||||
|
|
||||||
if(event.active.gain)
|
Uint8 i = SDL_GetAppState();
|
||||||
|
|
||||||
|
g_bHasFocus = i&SDL_APPINPUTFOCUS && i&SDL_APPACTIVE;
|
||||||
|
LOG->Trace("App %s focus (%i%i)", g_bHasFocus? "has":"doesn't have",
|
||||||
|
i&SDL_APPINPUTFOCUS, i&SDL_APPACTIVE);
|
||||||
|
|
||||||
|
if(g_bHasFocus)
|
||||||
BoostAppPri();
|
BoostAppPri();
|
||||||
else
|
else
|
||||||
RestoreAppPri();
|
RestoreAppPri();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update
|
* Update
|
||||||
|
|||||||
Reference in New Issue
Block a user