Fix: [SDL2] fullscreen always used the resolution of the first display (#11779)

pull/642/head
Patric Stout 5 months ago committed by GitHub
parent 302ba93471
commit 32fc740582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -665,7 +665,7 @@ bool VideoDriver_SDL_Base::ToggleFullscreen(bool fullscreen)
if (fullscreen) {
/* Find fullscreen window size */
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());
} else {
SDL_SetWindowSize(this->sdl_window, dm.w, dm.h);

Loading…
Cancel
Save