From 7132d14c324ba615fb0d73f83c9a1739378169f9 Mon Sep 17 00:00:00 2001 From: slipher Date: Sun, 21 Sep 2025 01:41:02 -0500 Subject: [PATCH 1/2] Fix SDL_SetWindowFullscreen error checking Missed spot from SDL 3 migration. Both the fullscreen argument (changed from flags to bool) and the return value (changed to bool) were wrong. The flags mistake was harmless as it converted to the correct bool value, but the error checking was unreachable. --- src/engine/sys/sdl_glimp.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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" ); From 79951d1738890786799821e0fe0622adf2cb9a69 Mon Sep 17 00:00:00 2001 From: slipher Date: Sun, 28 Sep 2025 12:36:13 -0500 Subject: [PATCH 2/2] Partially fix black loading screen on Mac --- src/engine/client/cl_scrn.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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() )