From 02cc3403ad217f5566a416771725b6aac97d4559 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Wed, 13 Mar 2024 00:22:14 +1000 Subject: [PATCH] vid_vsync: work around Wayland-specific init bug Fixes https://gitlab.com/xonotic/darkplaces/-/issues/413 Signed-off-by: bones_was_here --- vid_sdl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vid_sdl.c b/vid_sdl.c index 88ec122e..11868087 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -1480,8 +1480,12 @@ static void VID_SetVsync_c(cvar_t *var) if (!context) return; +/* +Can't check first: on Wayland SDL_GL_GetSwapInterval() may initially return 0 when vsync is on. +On Xorg it returns the correct value. if (SDL_GL_GetSwapInterval() == vsyncwanted) return; +*/ if (SDL_GL_SetSwapInterval(vsyncwanted) >= 0) Con_DPrintf("Vsync %s\n", vsyncwanted ? "activated" : "deactivated"); -- 2.39.2