qpa: Fix a crash in EGLPlatformContext::swapBuffers()

After internalWindow->present() is called, we cannot guarantee that the
current opengl context hasn't changed. If kwin changes the current opengl
context, bindContextFBO() can crash because there may not be current
QOpenGLContext.

BUG: 455435
This commit is contained in:
Vlad Zahorodnii 2022-06-17 11:14:33 +03:00
parent 34ce3dde87
commit 24bc3fed6c

View file

@ -120,8 +120,9 @@ void EGLPlatformContext::swapBuffers(QPlatformSurface *surface)
}
context()->makeCurrent(surface->surface());
glFlush();
internalWindow->present(window->swapFBO());
auto fbo = window->swapFBO();
window->bindContentFBO();
internalWindow->present(fbo);
}
}