1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-17 11:39:11 +00:00

Fix: [SDL2] fullscreen always used the resolution of the first display

This commit is contained in:
Patric Stout
2024-01-14 23:10:52 +01:00
parent 37610af0e4
commit 527c56a7df

View File

@@ -663,7 +663,7 @@ bool VideoDriver_SDL_Base::ToggleFullscreen(bool fullscreen)
if (fullscreen) { if (fullscreen) {
/* Find fullscreen window size */ /* Find fullscreen window size */
SDL_DisplayMode dm; SDL_DisplayMode dm;
if (SDL_GetCurrentDisplayMode(0, &dm) < 0) { if (SDL_GetCurrentDisplayMode(SDL_GetWindowDisplayIndex(this->sdl_window), &dm) < 0) {
Debug(driver, 0, "SDL_GetCurrentDisplayMode() failed: {}", SDL_GetError()); Debug(driver, 0, "SDL_GetCurrentDisplayMode() failed: {}", SDL_GetError());
} else { } else {
SDL_SetWindowSize(this->sdl_window, dm.w, dm.h); SDL_SetWindowSize(this->sdl_window, dm.w, dm.h);