Skip to content

Commit

Permalink
Avoid locking mac users to the desktop resolution
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Bishop-333 committed Dec 24, 2024
1 parent 638f449 commit ed34ce7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions code/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
9 changes: 8 additions & 1 deletion code/sdl/sdl_glimp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ed34ce7

Please sign in to comment.