From e0de6ea513251d8a9d4ed027a8e6a006c6407a00 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 This was adapted to 3.3-stable from 46cebb5081820418f2a20f3e90b07f9b1bd44b42. --- CONTRIBUTORS.md | 1 + README.md | 1 + src/egl_context.c | 2 ++ 3 files changed, 4 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e336c041..d43540d8 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -239,6 +239,7 @@ video tutorials. - Jari Vetoniemi - Ricardo Vieira - Nicholas Vitovitch + - Vladimír Vondruš - Simon Voordouw - Corentin Wallez - Torsten Walluhn diff --git a/README.md b/README.md index fd897ec7..15e6e24f 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ information on what to include when reporting a bug. - [Linux] Bugfix: Joysticks without buttons were ignored (#2042,#2043) - [Linux] Bugfix: A small amount of memory could leak if initialization failed (#2229) [EGL] Added loading of glvnd `libOpenGL.so.0` where available for OpenGL + - [EGL] Bugfix: `EGL_EXT_present_opaque` caused issues on X11 with Nvidia blob (#2365) - [GLX] Added loading of glvnd `libGLX.so.0` where available diff --git a/src/egl_context.c b/src/egl_context.c index 53667bd5..f8145bfe 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -651,8 +651,10 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window, if (!fbconfig->doublebuffer) setAttrib(EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER); +#if defined(_GLFW_WAYLAND) if (_glfw.egl.EXT_present_opaque) setAttrib(EGL_PRESENT_OPAQUE_EXT, !fbconfig->transparent); +#endif // _GLFW_WAYLAND setAttrib(EGL_NONE, EGL_NONE);