diff --git a/src/plugins/qpa/eglplatformcontext.cpp b/src/plugins/qpa/eglplatformcontext.cpp index 5a4b549ee2..2db58ad980 100644 --- a/src/plugins/qpa/eglplatformcontext.cpp +++ b/src/plugins/qpa/eglplatformcontext.cpp @@ -21,10 +21,6 @@ #include "logging.h" -#include - -#include - namespace KWin { namespace QPA @@ -81,13 +77,11 @@ bool EGLPlatformContext::makeCurrent(QPlatformSurface *surface) m_zombieRenderTargets.clear(); if (surface->surface()->surfaceClass() == QSurface::Window) { - // QOpenGLContextPrivate::setCurrentContext will be called after this - // method returns, but that's too late, as we need a current context in - // order to bind the content framebuffer object. - QOpenGLContextPrivate::setCurrentContext(context()); - Window *window = static_cast(surface); Swapchain *swapchain = window->swapchain(m_eglContext, m_eglDisplay->nonExternalOnlySupportedDrmFormats()); + if (!swapchain) { + return false; + } GraphicsBuffer *buffer = swapchain->acquire(); if (!buffer) {