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 commit is contained in:
Camilla Löwy 2023-12-07 16:51:13 +01:00
parent 68edc66aa4
commit 46cebb5081
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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.platform.platformID == GLFW_PLATFORM_WAYLAND)
{
if (_glfw.egl.EXT_present_opaque) if (_glfw.egl.EXT_present_opaque)
SET_ATTRIB(EGL_PRESENT_OPAQUE_EXT, !fbconfig->transparent); SET_ATTRIB(EGL_PRESENT_OPAQUE_EXT, !fbconfig->transparent);
}
SET_ATTRIB(EGL_NONE, EGL_NONE); SET_ATTRIB(EGL_NONE, EGL_NONE);