fix input not working after changing video settings, probably other
obscure problems
This commit is contained in:
@@ -134,6 +134,19 @@ static void ChangeToDirOfExecutable(const char *argv0)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdateHWnd()
|
||||||
|
{
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
/* Grab the window manager specific information */
|
||||||
|
SDL_SysWMinfo info;
|
||||||
|
SDL_VERSION(&info.version);
|
||||||
|
if ( SDL_GetWMInfo(&info) < 0 )
|
||||||
|
RageException::Throw( "SDL_GetWMInfo failed" );
|
||||||
|
|
||||||
|
g_hWndMain = info.window;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static RageDisplay::VideoModeParams GetCurVideoModeParams()
|
static RageDisplay::VideoModeParams GetCurVideoModeParams()
|
||||||
{
|
{
|
||||||
return RageDisplay::VideoModeParams(
|
return RageDisplay::VideoModeParams(
|
||||||
@@ -201,6 +214,9 @@ void ApplyGraphicOptions()
|
|||||||
|
|
||||||
StoreActualGraphicOptions( false );
|
StoreActualGraphicOptions( false );
|
||||||
|
|
||||||
|
/* Recreating the window changes the hwnd. */
|
||||||
|
UpdateHWnd();
|
||||||
|
|
||||||
/* Give the input handlers a chance to re-open devices as necessary. */
|
/* Give the input handlers a chance to re-open devices as necessary. */
|
||||||
INPUTMAN->WindowReset();
|
INPUTMAN->WindowReset();
|
||||||
}
|
}
|
||||||
@@ -939,15 +955,7 @@ int main(int argc, char* argv[])
|
|||||||
mySDL_EventState(SDL_QUIT, SDL_ENABLE);
|
mySDL_EventState(SDL_QUIT, SDL_ENABLE);
|
||||||
mySDL_EventState(SDL_ACTIVEEVENT, SDL_ENABLE);
|
mySDL_EventState(SDL_ACTIVEEVENT, SDL_ENABLE);
|
||||||
|
|
||||||
/* Grab the window manager specific information */
|
UpdateHWnd();
|
||||||
SDL_SysWMinfo info;
|
|
||||||
SDL_VERSION(&info.version);
|
|
||||||
if ( SDL_GetWMInfo(&info) < 0 )
|
|
||||||
RageException::Throw( "SDL_GetWMInfo failed" );
|
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
|
||||||
g_hWndMain = info.window;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SONGMAN->PreloadSongImages();
|
SONGMAN->PreloadSongImages();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user