From 9412316883f7c61821408268cf2d6ade5eeb4039 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Wed, 26 Mar 2008 16:20:21 +0000 Subject: [PATCH] Make sure fullscreen does not work for in_nograb when manually Alt-Entering, too. --- code/client/cl_keys.c | 2 +- code/sdl/sdl_glimp.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code/client/cl_keys.c b/code/client/cl_keys.c index 38f41d03..72fdbe8b 100644 --- a/code/client/cl_keys.c +++ b/code/client/cl_keys.c @@ -1164,7 +1164,7 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) { { if (keys[K_ALT].down) { - Key_ClearStates(); +// Key_ClearStates(); // Thilo: why should we clear the key states here? Cvar_SetValue( "r_fullscreen", !Cvar_VariableIntegerValue( "r_fullscreen" ) ); return; diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c index 3f5ba12f..a6c0a302 100644 --- a/code/sdl/sdl_glimp.c +++ b/code/sdl/sdl_glimp.c @@ -662,6 +662,13 @@ void GLimp_EndFrame( void ) fullscreen = qtrue; else fullscreen = qfalse; + + 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" ); + r_fullscreen->modified = qfalse; + } // Is the state we want different from the current state? if( !!r_fullscreen->integer != fullscreen )