* Don't set SE_KEY event to ctrl-h; I don't think this makes sense

* Don't warp the mouse on deactivation unless the cursor is in the window
  already; this fixes in_nograb
* Stop grabbing the mouse in windowed mode when there is no sense in
  doing so
* Make sure that IN_Restart is only called on r_fullscreen modification
  if a mode change actually takes place
This commit is contained in:
Tim Angus 2008-08-22 22:16:37 +00:00
parent e4e0568641
commit acbf982689
2 changed files with 53 additions and 36 deletions

View file

@ -725,18 +725,16 @@ void GLimp_EndFrame( void )
if( r_fullscreen->modified )
{
qboolean fullscreen;
qboolean needToToggle = qtrue;
qboolean sdlToggled = qfalse;
SDL_Surface *s = SDL_GetVideoSurface( );
if( s )
{
// Find out the current state
if( s->flags & SDL_FULLSCREEN )
fullscreen = qtrue;
else
fullscreen = qfalse;
fullscreen = !!( s->flags & SDL_FULLSCREEN );
if (r_fullscreen->integer && Cvar_VariableIntegerValue( "in_nograb" ))
if( r_fullscreen->integer && Cvar_VariableIntegerValue( "in_nograb" ) )
{
ri.Printf( PRINT_ALL, "Fullscreen not allowed with in_nograb 1\n");
ri.Cvar_Set( "r_fullscreen", "0" );
@ -744,17 +742,20 @@ void GLimp_EndFrame( void )
}
// Is the state we want different from the current state?
if( !!r_fullscreen->integer != fullscreen )
needToToggle = !!r_fullscreen->integer != fullscreen;
if( needToToggle )
sdlToggled = SDL_WM_ToggleFullScreen( s );
else
sdlToggled = qtrue;
}
// SDL_WM_ToggleFullScreen didn't work, so do it the slow way
if( !sdlToggled )
Cbuf_AddText( "vid_restart" );
if( needToToggle )
{
// SDL_WM_ToggleFullScreen didn't work, so do it the slow way
if( !sdlToggled )
Cbuf_AddText( "vid_restart" );
IN_Restart( );
IN_Restart( );
}
r_fullscreen->modified = qfalse;
}