x11: Disable the X Synchronization Extension by default

Under the right conditions, this extension can result is smoother resizing when rendering with OpenGL, however, it is known to cause problems in certain cases, such as when handling presentation externally.

Gate it behind a hint, and disable it by default. Developers can selectively enable it when they verify that they meet the criteria for using it, and that it behaves correctly in their apps/games.

(cherry picked from commit b8545fce54)
This commit is contained in:
Frank Praznik
2026-05-05 12:51:45 -04:00
parent 05d8af1a75
commit 85ebd16fb2
2 changed files with 27 additions and 1 deletions

View File

@@ -585,7 +585,8 @@ bool X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properties
}
const bool force_override_redirect = SDL_GetHintBoolean(SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT, false);
const bool use_resize_sync = !!(window->flags & SDL_WINDOW_OPENGL); // Doesn't work well with Vulkan
const bool use_resize_sync = SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_ENABLE_XSYNC_EXT, false) &&
(window->flags & SDL_WINDOW_OPENGL) != 0; // Doesn't work well with Vulkan
SDL_WindowData *windowdata;
Display *display = data->display;
int screen = displaydata->screen;