From fed2e142f5c4da9d7a98bbe5560b4b60cd6bedad Mon Sep 17 00:00:00 2001 From: Yamagi Date: Wed, 13 Nov 2019 20:29:13 +0100 Subject: [PATCH] SDL_WINDOW_FULLSCREEN_DESKTOP implies SDL_WINDOW_FULLSCREEN. The docs "forget" to mention that. So it's not enough to check for SDL_WINDOW_FULLSCREEN alone, we would trigger the code intented for the real fullscreen if we're switching to / running in fullscreen desktop mode. Add and addition check that SDL_WINDOW_FULLSCREEN_DESKTOP isn't set. This may fix issue #484. --- src/client/vid/glimp_sdl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/client/vid/glimp_sdl.c b/src/client/vid/glimp_sdl.c index e906123b..bd35db3a 100644 --- a/src/client/vid/glimp_sdl.c +++ b/src/client/vid/glimp_sdl.c @@ -108,7 +108,9 @@ CreateSDLWindow(int flags, int w, int h) return false; } - if ((flags & SDL_WINDOW_FULLSCREEN) && ((real_mode.w != w) || (real_mode.h != h))) + /* SDL_WINDOW_FULLSCREEN_DESKTOP implies SDL_WINDOW_FULLSCREEN! */ + if (((flags & SDL_WINDOW_FULLSCREEN) && (~flags & SDL_WINDOW_FULLSCREEN_DESKTOP)) + && ((real_mode.w != w) || (real_mode.h != h))) { Com_Printf("Current display mode isn't requested display mode\n"); @@ -157,9 +159,11 @@ CreateSDLWindow(int flags, int w, int h) } } - /* Normally SDL stays at desktop refresh rate or chooses - something sane. Some player may want to override that. */ - if (flags & SDL_WINDOW_FULLSCREEN) + /* Normally SDL stays at desktop refresh rate or chooses something + sane. Some player may want to override that. + + Reminder: SDL_WINDOW_FULLSCREEN_DESKTOP implies SDL_WINDOW_FULLSCREEN! */ + if ((flags & SDL_WINDOW_FULLSCREEN) && (~flags & SDL_WINDOW_FULLSCREEN_DESKTOP)) { if (vid_rate->value > 0) {