From ed34ce771ad9269839fbddb52a70097d197b368f Mon Sep 17 00:00:00 2001 From: Bishop-333 <99912467+Bishop-333@users.noreply.github.com> Date: Tue, 24 Dec 2024 10:10:49 +0100 Subject: [PATCH] Avoid locking mac users to the desktop resolution This was cool for ability to ALT+TAB but the desktop resolution is below what the mac is capable and not good enough. You can now switch res on mac but ALT+TAB will be enabled only if you set desktop res --- code/client/cl_main.c | 4 ++++ code/sdl/sdl_glimp.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/code/client/cl_main.c b/code/client/cl_main.c index cb2e66ff3..9e152c518 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -3820,7 +3820,11 @@ static void CL_InitGLimp_Cvars( void ) Cvar_CheckRange( r_noborder, "0", "1", CV_INTEGER ); Cvar_SetDescription( r_noborder, "Setting to 1 will remove window borders and title bar in windowed mode, hold ALT to drag & drop it with opened console." ); +#ifdef MACOS_X + r_mode = Cvar_Get( "r_mode", "-2", CVAR_ARCHIVE | CVAR_LATCH ); +#else r_mode = Cvar_Get( "r_mode", "-1", CVAR_ARCHIVE | CVAR_LATCH ); +#endif Cvar_CheckRange( r_mode, "-2", va( "%i", s_numVidModes-1 ), CV_INTEGER ); Cvar_SetDescription( r_mode, "Set video mode:\n -2 - use current desktop resolution\n -1 - use \\r_customWidth and \\r_customHeight\n 0..N - enter \\modelist for details" ); r_modeFullscreen = Cvar_Get( "r_modeFullscreen", "", CVAR_ARCHIVE | CVAR_LATCH ); diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c index 372c23b71..ea8331f14 100644 --- a/code/sdl/sdl_glimp.c +++ b/code/sdl/sdl_glimp.c @@ -278,7 +278,14 @@ static int GLW_SetMode( int mode, const char *modeFS, qboolean fullscreen, qbool if ( fullscreen ) { #ifdef MACOS_X - flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; + if ( r_mode->integer == -2 ) + { + flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; + } + else + { + flags |= SDL_WINDOW_FULLSCREEN; + } #else flags |= SDL_WINDOW_FULLSCREEN; #endif