summaryrefslogtreecommitdiff
path: root/Source/Core/Common/GL/GLInterface/EGLX11.cpp
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2026-08-02 02:57:00 +1200
committerGitHub <noreply@github.com>2026-08-02 02:57:00 +1200
commit5c6dcce721ee3fe3814d41aaa3e2e55f07a821e7 (patch)
tree8ca4555835805d63a157041a850b5cb11b4e728d /Source/Core/Common/GL/GLInterface/EGLX11.cpp
parentad7e793548684a183593326584313f7e2bdce4d9 (diff)
parent1c2b7fbf7f4239f24d4ce60ef7c8054f75a767c9 (diff)
Merge pull request #14758 from JoshuaVandaele/egl-platform-nowayland
Forbid EGL_PLATFORM to be "wayland"
Diffstat (limited to 'Source/Core/Common/GL/GLInterface/EGLX11.cpp')
-rw-r--r--Source/Core/Common/GL/GLInterface/EGLX11.cpp17
1 files changed, 17 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.