diff options
| author | Joshua Vandaƫle <joshua@vandaele.software> | 2026-07-25 09:21:00 +0200 |
|---|---|---|
| committer | Joshua Vandaƫle <joshua@vandaele.software> | 2026-07-31 10:34:00 +0200 |
| commit | 1c2b7fbf7f4239f24d4ce60ef7c8054f75a767c9 (patch) | |
| tree | 3a6e0417b54ad3d1806de666158fcb00b7298615 | |
| parent | f1b4345d0854f1c4e5e8eb683237a771c6de5456 (diff) | |
EGLX11: Forbid EGL_PLATFORM to be "wayland"
| -rw-r--r-- | Source/Core/Common/GL/GLInterface/EGLX11.cpp | 17 | ||||
| -rw-r--r-- | Source/Core/Common/GL/GLInterface/EGLX11.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/Source/Core/Common/GL/GLInterface/EGLX11.cpp b/Source/Core/Common/GL/GLInterface/EGLX11.cpp index f430898361..1795ddd2dd 100644 --- a/Source/Core/Common/GL/GLInterface/EGLX11.cpp +++ b/Source/Core/Common/GL/GLInterface/EGLX11.cpp @@ -3,6 +3,23 @@ #include "Common/GL/GLInterface/EGLX11.h" +#include <cstdlib> + +#include "Common/StringUtil.h" + +GLContextEGLX11::GLContextEGLX11() +{ + // HACK: If EGL_PLATFORM is set to "wayland", Dolphin will still use GLContextEGLX11 due to our + // lack of proper Wayland support, and crash. + // Some distros have started aggressively setting that environment variable, bypassing the usual + // runtime detection. Thus, clear that environment variable if it forces wayland. + const char* current_egl_platform = getenv("EGL_PLATFORM"); + const bool replace_egl_platform = + current_egl_platform != nullptr && + Common::CaseInsensitiveContains(current_egl_platform, "wayland"); + setenv("EGL_PLATFORM", "", replace_egl_platform); +} + GLContextEGLX11::~GLContextEGLX11() { // The context must be destroyed before the window. diff --git a/Source/Core/Common/GL/GLInterface/EGLX11.h b/Source/Core/Common/GL/GLInterface/EGLX11.h index 6f30333341..03560d8581 100644 --- a/Source/Core/Common/GL/GLInterface/EGLX11.h +++ b/Source/Core/Common/GL/GLInterface/EGLX11.h @@ -11,6 +11,7 @@ class GLContextEGLX11 final : public GLContextEGL { public: + GLContextEGLX11(); ~GLContextEGLX11() override; void Update() override; |
