From 34f7d76aebf336b05f8502ef49f7df5b9f09e136 Mon Sep 17 00:00:00 2001 From: GenericHeroGuy Date: Sun, 17 Aug 2025 18:06:35 +0200 Subject: [PATCH] Switch to calling SDL_GetDesktopDisplayMode in VID_GetRefreshRate Avoids freezing on SDL3 + X11, otherwise behaves the same on My Machine(tm) Also remove that annoying useless mouse grab on startup --- src/sdl/i_video.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/sdl/i_video.cpp b/src/sdl/i_video.cpp index 7c08658fb..dd50ff13c 100644 --- a/src/sdl/i_video.cpp +++ b/src/sdl/i_video.cpp @@ -123,7 +123,6 @@ static INT32 mousemovex = 0, mousemovey = 0; // SDL vars static SDL_Surface *vidSurface = NULL; static UINT32 localPalette[256]; -static SDL_bool mousegrabok = SDL_TRUE; static SDL_bool wrapmouseok = SDL_FALSE; #define HalfWarpMouse(x,y) if (wrapmouseok) SDL_WarpMouseInWindow(window, (Uint16)(x/2),(Uint16)(y/2)) static SDL_bool usesdl2soft = SDL_FALSE; @@ -419,7 +418,7 @@ static UINT32 VID_GetRefreshRate(void) return 0; } - if (SDL_GetCurrentDisplayMode(index, &m) != 0) + if (SDL_GetDesktopDisplayMode(index, &m) != 0) { // Error has occurred. return 0; @@ -1743,17 +1742,11 @@ void I_StartupGraphics(void) I_ShutdownTTF(); #endif - if (M_CheckParm("-nomousegrab")) - mousegrabok = SDL_FALSE; - VID_Command_Info_f(); SDLdoUngrabMouse(); SDL_RaiseWindow(window); - if (mousegrabok && !disable_mouse) - SDLdoGrabMouse(); - graphics_started = true; }