opengl/eglcontext: tell Qt when the OpenGL context gets changed

Otherwise, Qt thinks the old context is still current and will do things like
destroying VAOs with KWin's context, which ends up destroying the VAO of the
context and breaks rendering.

BUG: 479094
This commit is contained in:
Xaver Hugl 2024-02-21 20:58:09 +01:00
parent 564bfafb57
commit 8c3332f619

View file

@ -66,6 +66,10 @@ EglContext::~EglContext()
bool EglContext::makeCurrent(EGLSurface surface) const
{
if (QOpenGLContext *context = QOpenGLContext::currentContext()) {
// Workaround to tell Qt that no QOpenGLContext is current
context->doneCurrent();
}
return eglMakeCurrent(m_display->handle(), surface, surface, m_handle) == EGL_TRUE;
}