diff --git a/src/render/wiiu/SDL_rpresent_wiiu.c b/src/render/wiiu/SDL_rpresent_wiiu.c index c0ac7a1cc5b8a..de69b8f860f23 100644 --- a/src/render/wiiu/SDL_rpresent_wiiu.c +++ b/src/render/wiiu/SDL_rpresent_wiiu.c @@ -38,9 +38,21 @@ static SDL_bool tvDrcEnabled = SDL_FALSE; int WIIU_SDL_SetVSync(SDL_Renderer * renderer, const int vsync) { - GX2SetSwapInterval(vsync ? 1 : 0); + WIIU_VideoData *videodata = (WIIU_VideoData *) SDL_GetVideoDevice()->driverdata; + uint32_t swapInterval = vsync ? 1 : 0; - if (GX2GetSwapInterval() > 0) { + // Don't attempt to update swap interval if in background + if (!videodata->hasForeground) { + return 0; + } + + if (GX2GetSwapInterval() == swapInterval) { + return 0; + } + + GX2SetSwapInterval(swapInterval); + + if (swapInterval > 0) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } else { renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC;