diff --git a/src/engine/client/cl_scrn.cpp b/src/engine/client/cl_scrn.cpp index 1cc079411c..b969bbd14b 100644 --- a/src/engine/client/cl_scrn.cpp +++ b/src/engine/client/cl_scrn.cpp @@ -37,6 +37,10 @@ Maryland 20850 USA. #include "client.h" #include "qcommon/q_unicode.h" +#if defined(__APPLE__) && defined(BUILD_GRAPHICAL_CLIENT) +#include +#endif + bool scr_initialized; // ready to draw /* @@ -299,6 +303,16 @@ void SCR_UpdateScreen() recursive = 1; +#if defined(__APPLE__) && defined(BUILD_GRAPHICAL_CLIENT) + if ( cls.state == connstate_t::CA_LOADING ) + { + // Mitigate #1812. Calling SDL_PumpEvents 3 times makes the loading screen frames show up, + // except the first one. + SDL_PumpEvents(); + SDL_PumpEvents(); + SDL_PumpEvents(); + } +#endif // If there is no VM, there are also no rendering commands issued. Stop the renderer in // that case. if ( cgvm.IsActive() ) diff --git a/src/engine/sys/sdl_glimp.cpp b/src/engine/sys/sdl_glimp.cpp index 49d4d6c568..1580598a94 100644 --- a/src/engine/sys/sdl_glimp.cpp +++ b/src/engine/sys/sdl_glimp.cpp @@ -988,10 +988,7 @@ static bool GLimp_RecreateWindowWhenChange( const bool fullscreen, const bool bo if ( fullscreen != currentFullscreen ) { - Uint32 flags = fullscreen ? SDL_WINDOW_FULLSCREEN : 0; - int sdlToggled = SDL_SetWindowFullscreen( window, flags ); - - if ( sdlToggled < 0 ) + if ( !SDL_SetWindowFullscreen( window, fullscreen ) ) { GLimp_DestroyWindowIfExists(); @@ -2914,7 +2911,6 @@ void GLimp_HandleCvars() if ( Util::optional wantFullscreen = r_fullscreen.GetModifiedValue() ) { - int sdlToggled = false; bool needToToggle = true; bool fullscreen = !!( SDL_GetWindowFlags( window ) & SDL_WINDOW_FULLSCREEN ); @@ -2923,10 +2919,7 @@ void GLimp_HandleCvars() if ( needToToggle ) { - Uint32 flags = *wantFullscreen ? SDL_WINDOW_FULLSCREEN : 0; - sdlToggled = SDL_SetWindowFullscreen( window, flags ); - - if ( sdlToggled < 0 ) + if ( !SDL_SetWindowFullscreen( window, *wantFullscreen ) ) { Log::Warn( "SDL_SetWindowFullscreen failed: %s", SDL_GetError() ); Log::Warn( "Trying vid_restart" );