Răsfoiți Sursa

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 an în urmă
părinte
comite
46cebb5081
2 a modificat fișierele cu 6 adăugiri și 2 ștergeri
  1. 1 0
      CONTRIBUTORS.md
  2. 5 2
      src/egl_context.c

+ 1 - 0
CONTRIBUTORS.md

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

+ 5 - 2
src/egl_context.c

@@ -704,8 +704,11 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
     if (!fbconfig->doublebuffer)
     if (!fbconfig->doublebuffer)
         SET_ATTRIB(EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER);
         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);
     SET_ATTRIB(EGL_NONE, EGL_NONE);