From 46cebb5081820418f2a20f3e90b07f9b1bd44b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 7 Dec 2023 16:51:13 +0100 Subject: [PATCH] EGL: Only use EGL_EXT_present_opaque on Wayland The EGL_EXT_present_opaque extension is primarily a workaround meant for Wayland, even if the language in it doesn't mention this. GLFW previously always enabled this extension where supported. This caused issues on X11 when running the Nvidia binary blob. This commit ensures the extension is only enabled on Wayland. Fixes #2365 --- CONTRIBUTORS.md | 1 + src/egl_context.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 40569702..a78fd5ce 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -252,6 +252,7 @@ video tutorials. - Jari Vetoniemi - Ricardo Vieira - Nicholas Vitovitch + - Vladimír Vondruš - Simon Voordouw - Corentin Wallez - Torsten Walluhn diff --git a/src/egl_context.c b/src/egl_context.c index 4f76d351..a18590b9 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -704,8 +704,11 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window, if (!fbconfig->doublebuffer) SET_ATTRIB(EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER); - if (_glfw.egl.EXT_present_opaque) - SET_ATTRIB(EGL_PRESENT_OPAQUE_EXT, !fbconfig->transparent); + if (_glfw.platform.platformID == GLFW_PLATFORM_WAYLAND) + { + if (_glfw.egl.EXT_present_opaque) + SET_ATTRIB(EGL_PRESENT_OPAQUE_EXT, !fbconfig->transparent); + } SET_ATTRIB(EGL_NONE, EGL_NONE);