From d69f6588355415ed38c40ecd6428888d85a7627b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 2 Oct 2025 15:19:41 -0700 Subject: [PATCH] Make sure the current resolution is in the fullscreen mode list Custom resolutions don't enumerate normally, but make sure the current resolution is in the mode list. Fixes https://github.com/libsdl-org/SDL/issues/11551 (cherry picked from commit b1c2dd8433ff1c0acec21db998dc85615d96a6db) --- src/video/windows/SDL_windowsmodes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index 77ebab29a5..aa87524ccd 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -770,7 +770,8 @@ bool WIN_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) dxgi_output = WIN_GetDXGIOutput(_this, data->DeviceName); - for (i = 0;; ++i) { + // Make sure we add the current mode to the list in case it's a custom mode that doesn't enumerate + for (i = ENUM_CURRENT_SETTINGS; ; ++i) { if (!WIN_GetDisplayMode(_this, dxgi_output, data->MonitorHandle, data->DeviceName, i, &mode, NULL, NULL)) { break; }