From 4d6196c3d376171c2111a2eb64ba1ef54d3135cd Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 22 Nov 2025 18:51:32 -0600 Subject: [PATCH] Use EGL for all X11 GL context creation in Qt and SDL Using a mix of GLX and EGL can cause interoperability issues when our EGLRenderer tries to bind an EGL context while Qt already has a GLX context bound on the same thread. This was the source of a number of confusing EGLRenderer failures over the years. --- app/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 8fb91494..cfd1dfed 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -475,12 +475,12 @@ int main(int argc, char *argv[]) #endif } -#ifndef Q_PROCESSOR_X86 // Some ARM and RISC-V embedded devices don't have working GLX which can cause // SDL to fail to find a working OpenGL implementation at all. Let's force EGL - // on non-x86 platforms, since GLX is deprecated anyway. + // on all platforms for both SDL and Qt. This also avoids GLX-EGL interop issues + // when trying to use EGL on the main thread after Qt uses GLX. SDL_SetHint(SDL_HINT_VIDEO_X11_FORCE_EGL, "1"); -#endif + qputenv("QT_XCB_GL_INTEGRATION", "xcb_egl"); #ifdef Q_OS_MACOS // This avoids using the default keychain for SSL, which may cause