Limit the work around against wrong resolutions to fullscreen.

When Q2 runs in windowed mode, SDL can never switch to the wrong the
resolution. The resolution isn't switched, of course. The work around
prevented Q2 from creating Windows larger than the resolution of the
primary display. For example a primary display of 1280x1024 prevented
a window size of 1680x1050 on the much bigger secondary display.
This commit is contained in:
Yamagi 2020-10-06 17:36:10 +02:00
parent dfaf33e478
commit 0a159eefb2

13
src/client/vid/glimp_sdl.c Normal file → Executable file
View file

@ -104,14 +104,17 @@ CreateSDLWindow(int flags, int w, int h)
https://bugzilla.libsdl.org/show_bug.cgi?id=4700 */
SDL_DisplayMode real_mode;
if (SDL_GetWindowDisplayMode(window, &real_mode) != 0)
if ((flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP)) == SDL_WINDOW_FULLSCREEN)
{
SDL_DestroyWindow(window);
window = NULL;
if (SDL_GetWindowDisplayMode(window, &real_mode) != 0)
{
SDL_DestroyWindow(window);
window = NULL;
Com_Printf("Can't get display mode: %s\n", SDL_GetError());
Com_Printf("Can't get display mode: %s\n", SDL_GetError());
return false;
return false;
}
}
/* SDL_WINDOW_FULLSCREEN_DESKTOP implies SDL_WINDOW_FULLSCREEN! */