GNOME Bugzilla – Bug 728978
Don't set EGL_PLATFORM
Last modified: 2014-11-30 23:20:21 UTC
Created attachment 275167 [details] [review] patch to fix the issue This environment variable predates the reliable platform detection in mesa and typically just causes crashes when the specified platform doesn't match what's passed in. Aside from being unecessary and problematic it also leaks into the GNOME session, preventing clients from automatically detecting the wayland platform.
Thanks for the patch. I've pushed it to master and the 1.18 branch: https://git.gnome.org/browse/cogl/commit/?id=e3e516612dcce10b949370bf82a6d82 https://git.gnome.org/browse/cogl/commit/?h=cogl-1.18&id=8fb9cea4515161effda The EGL_PLATFORM part in the KMS winsys was added in August from bug 705836. However it looks like that was only added to compensate for the fact that the Wayland winsys sets the environment variable which would mess up the KMS winsys if it is tried after the Wayland winsys. The Wayland part was added back in 2011 in commit 653d59af043. I think it's safe to assume that at that point the Wayland backend was experimental and has changed a lot since then so we can safely revert it.
I'm not convinced everything is working correctly here. Without EGL_PLATFORM set in the environment, in a gnome-wayland session (I have with gtk+ patched to use wayland first, but I don't think it matters), eglinfo uses the X11 platfrom via Xwayland. If DISPLAY is unset, initialisation fails unless EGL_PLATFORM is set to wayland.
On the other hand, lauching weston works, as does running SDL2 applications using the wayland driver.