From a9267bdcdc5f95f613820a77a8ee606c7235b572 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sun, 19 Jun 2022 12:54:35 +0300 Subject: [PATCH] plugins/qpa: Assume there's current context when swapBuffers() is called It can happen that the window is resized after makeCurrent() and before swapBuffers(). In that case, context()->makeCurrent() will re-create the fbo and qpa will present an uninitialize fbo. Assume that there's current context when swapBuffers() is called. Other QPA already do this, for example, QtWayland. This would make the behavior of our qpa consistent with QtWayland and fix resizing the fbo in swapBuffers(). In general, kwin should be able to handle size mismatch between the fbo and QWindow, but as an extra hardening measure, we could forbid resizing windows during rendering, this can be done later though. --- src/plugins/qpa/eglplatformcontext.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/qpa/eglplatformcontext.cpp b/src/plugins/qpa/eglplatformcontext.cpp index 5e890e6e98..d2ebda7d76 100644 --- a/src/plugins/qpa/eglplatformcontext.cpp +++ b/src/plugins/qpa/eglplatformcontext.cpp @@ -118,7 +118,6 @@ void EGLPlatformContext::swapBuffers(QPlatformSurface *surface) if (!internalWindow) { return; } - context()->makeCurrent(surface->surface()); glFlush(); auto fbo = window->swapFBO(); window->bindContentFBO();