wgpu
wgpu copied to clipboard
egl: recreate Wayland context if X surface is supplied
Connections Link to the issues addressed by this PR, or dependent PRs in other repositories Fixes #2762
Description Describe what problem this is solving, and how it's solved. When user has libwayland and WAYLAND_DISPLAY, wgpu creates EGLDisplay using EGL_PLATFORM_WAYLAND_KHR, which is incompatible with X windows. However, application might use X in Wayland environment, and so its surface will have incompatible type thus leading to panic. In this case reinitialize the EGLDisplay with EGL_PLATFORM_X11_KHR.
Testing Explain how this change is tested. WINIT_UNIX_BACKEND=x11