Do not call randomly eglGetError() after eglMakeCurrent

If it failed, it will return accordingly, and then we get to call
eglGetError, only when it fails.
This commit is contained in:
Aleix Pol 2020-09-23 02:03:45 +02:00 committed by Aleix Pol Gonzalez
parent 13dcb46888
commit 9479c0d6b4

View file

@ -343,12 +343,7 @@ bool EglGbmBackend::makeContextCurrent(const Output &output) const
return false;
}
if (eglMakeCurrent(eglDisplay(), surface, surface, context()) == EGL_FALSE) {
qCCritical(KWIN_DRM) << "Make Context Current failed";
return false;
}
EGLint error = eglGetError();
if (error != EGL_SUCCESS) {
qCWarning(KWIN_DRM) << "Error occurred while creating context " << error;
qCCritical(KWIN_DRM) << "Make Context Current failed" << eglGetError();
return false;
}
return true;