From a730dfd21272078794c37cdf9211d44b958ad5a6 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 9 Nov 2025 18:53:26 +0100 Subject: [PATCH] fix checking for if display changed --- src/sdl/i_video.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 868aee3cd..f8f840a1d 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1501,8 +1501,13 @@ static void I_FillScreenResolutionsList(void) int count = 0; char desired_resolution[256]; + currentDisplayIndex = SDL_GetWindowDisplayIndex(window); + + // No valid index if (currentDisplayIndex < 0) - currentDisplayIndex = SDL_GetWindowDisplayIndex(window); + { + return; + } // didnt change screen, no need to redo the list if (currentDisplayIndex == oldDisplayIndex) @@ -1512,12 +1517,6 @@ static void I_FillScreenResolutionsList(void) oldDisplayIndex = currentDisplayIndex; - // No valid index - if (currentDisplayIndex < 0) - { - return; - } - // Don't call SDL_ListModes if SDL has not been initialized count = SDL_GetNumDisplayModes(currentDisplayIndex);