kwin: avoid SEGFAULT in case of egl_glx

The mesa egl_glx egl driver only provides indirect rendering which is
insufficient for GLES2.
This commit is contained in:
Philipp Knechtges 2011-12-01 22:41:10 +01:00
parent 9e2b6edf02
commit cd585972ae

View file

@ -310,6 +310,12 @@ bool CompositingPrefs::initEGLContext()
EGLConfig configs[1024]; EGLConfig configs[1024];
eglChooseConfig(mEGLDisplay, config_attribs, configs, 1024, &count); eglChooseConfig(mEGLDisplay, config_attribs, configs, 1024, &count);
if (count == 0) {
// egl_glx only supports indirect rendering, which itself does not allow GLES2
kWarning(1212) << "You might be using mesa egl_glx, which is not supported!";
return false;
}
EGLint visualId = XVisualIDFromVisual((Visual*)QX11Info::appVisual()); EGLint visualId = XVisualIDFromVisual((Visual*)QX11Info::appVisual());
EGLConfig config = configs[0]; EGLConfig config = configs[0];