diff --git a/intern/ghost/intern/GHOST_ContextEGL.cc b/intern/ghost/intern/GHOST_ContextEGL.cc index be4a6016495..c406c284ba7 100644 --- a/intern/ghost/intern/GHOST_ContextEGL.cc +++ b/intern/ghost/intern/GHOST_ContextEGL.cc @@ -472,7 +472,27 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext() } if (m_nativeWindow != 0) { - m_surface = ::eglCreateWindowSurface(m_display, m_config, m_nativeWindow, nullptr); + std::vector surface_attrib_list; + surface_attrib_list.reserve(3); +#if WITH_GHOST_WAYLAND + /* Fix transparency issue on Wayland + Nouveau/Zink+NVK. Due to unsupported texture formats + * drivers can hit transparency code-paths resulting in showing the desktop in viewports. + * + * See #102994. */ + /* EGL_EXT_present_opaque isn't added to the latest release of epoxy, but is part of the latest + * EGL https://github.com/KhronosGroup/EGL-Registry/blob/main/api/egl.xml */ + if (epoxy_has_egl_extension(m_display, "EGL_EXT_present_opaque")) { +# ifndef EGL_PRESENT_OPAQUE_EXT +# define EGL_PRESENT_OPAQUE_EXT 0x31DF +# endif + surface_attrib_list.push_back(EGL_PRESENT_OPAQUE_EXT); + surface_attrib_list.push_back(EGL_TRUE); + } +#endif + surface_attrib_list.push_back(EGL_NONE); + + m_surface = ::eglCreateWindowSurface( + m_display, m_config, m_nativeWindow, surface_attrib_list.data()); m_surface_from_native_window = true; } else {