From beac43f41f1ed6b15ff5ca711721d21853c4efbc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 12 Feb 2024 16:01:48 -0800 Subject: [PATCH] Revert "wayland: Don't initialize OpenGL when the window flags didn't specify it" This reverts commit f522c5380cb371a83d21d3d01f088ce5b9531263. We don't want this change for SDL2, and we're doing further investigation for SDL3. Fixes https://github.com/libsdl-org/SDL/issues/9035 (cherry picked from commit 120b8d4189d0979e4838daeb25d5a69e6260f5e0) --- src/video/wayland/SDL_waylandwindow.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 08df3638c2..483ec1926c 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -1994,6 +1994,13 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) c = _this->driverdata; window->driverdata = data; + if (!(window->flags & SDL_WINDOW_VULKAN)) { + if (!(window->flags & SDL_WINDOW_OPENGL)) { + SDL_GL_LoadLibrary(NULL); + window->flags |= SDL_WINDOW_OPENGL; + } + } + if (window->x == SDL_WINDOWPOS_UNDEFINED) { window->x = 0; }