GHOST/Wayland: only disable VSync when using the OpenGL backend

Also add a reference to SDL's bug report and some notes.
This commit is contained in:
Campbell Barton
2025-08-14 01:13:30 +00:00
parent e06f9be733
commit 3198b336e1

View File

@@ -2088,10 +2088,20 @@ GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system,
* isn't essential, it reduces flickering. */
wl_surface_commit(window_->wl.surface);
window_->is_init = true;
#ifdef WITH_OPENGL_BACKEND
if (type == GHOST_kDrawingContextTypeOpenGL) {
/* NOTE(@ideasman42): Set the swap interval to 0 (disable VSync) to prevent blocking.
* This was reported for SDL in 2021 so it may be good to revisit this decision
* at some point since forcing the VSync setting seems a heavy-handed,
* especially if the issue gets resolved up-stream.
*
* For reference: https://github.com/libsdl-org/SDL/issues/4335
* From the report the compositor causing problems was GNOME's Mutter. */
setSwapInterval(0);
}
#endif
/* Set swap interval to 0 to prevent blocking. */
setSwapInterval(0);
window_->is_init = true;
}
GHOST_WindowWayland::~GHOST_WindowWayland()