Browse Source

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
Camilla Löwy 1 year ago
parent
commit
46cebb5081
2 changed files with 6 additions and 2 deletions
  1. 1 0
      CONTRIBUTORS.md
  2. 5 2
      src/egl_context.c

+ 1 - 0
CONTRIBUTORS.md

@@ -252,6 +252,7 @@ video tutorials.
  - Jari Vetoniemi
  - Ricardo Vieira
  - Nicholas Vitovitch
+ - Vladimír Vondruš
  - Simon Voordouw
  - Corentin Wallez
  - Torsten Walluhn

+ 5 - 2
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);