ref: 1a090dd9f9adad6afdf93274fc5f381b4d9f7342
parent: 21b8680c21fd7ba41b2c289a1240bf0b8125cca7
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Oct 22 12:48:50 EDT 2024
vid_sdl: correctly react to fullscreen setting coming from the WM
--- a/in_sdl.c
+++ b/in_sdl.c
@@ -33,6 +33,8 @@
Cbuf_AddText("menu_quit\n");
break;
case SDL_EVENT_WINDOW_RESIZED:
+ case SDL_EVENT_WINDOW_ENTER_FULLSCREEN:
+ case SDL_EVENT_WINDOW_LEAVE_FULLSCREEN:
vid.resized = true;
break;
case SDL_EVENT_WINDOW_CLOSE_REQUESTED:
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -28,7 +28,7 @@
{
if(v_fullscreen.value >= 1)
return SDL_WINDOW_FULLSCREEN;
- return 0;
+ return SDL_WINDOW_RESIZABLE;
}
static void
@@ -167,7 +167,7 @@
SDL_DestroyWindow(win);
hints();
- if(!SDL_CreateWindowAndRenderer("quake", w, h, cvarwinflags() | SDL_WINDOW_RESIZABLE, &win, &rend))
+ if(!SDL_CreateWindowAndRenderer("quake", w, h, cvarwinflags(), &win, &rend))
fatal("SDL_CreateWindow: %s", SDL_GetError());
SDL_SetWindowResizable(win, true);
SDL_SetWindowMinimumSize(win, 320, 240);