Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/engine/client/cl_scrn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Maryland 20850 USA.
#include "client.h"
#include "qcommon/q_unicode.h"

#if defined(__APPLE__) && defined(BUILD_GRAPHICAL_CLIENT)
#include <SDL3/SDL.h>
#endif

bool scr_initialized; // ready to draw

/*
Expand Down Expand Up @@ -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() )
Expand Down
11 changes: 2 additions & 9 deletions src/engine/sys/sdl_glimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -2914,7 +2911,6 @@ void GLimp_HandleCvars()

if ( Util::optional<bool> wantFullscreen = r_fullscreen.GetModifiedValue() )
{
int sdlToggled = false;
bool needToToggle = true;
bool fullscreen = !!( SDL_GetWindowFlags( window ) & SDL_WINDOW_FULLSCREEN );

Expand All @@ -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" );
Expand Down