From 9c0056c96d4b238a39bb97d8fd40196170ce5558 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 20 Dec 2022 17:48:05 +0200 Subject: [PATCH] Make opengl cursor delegate push fbo This case was overlooked in 8071ade9a83b4c320f4d22bf2f727e20ffdf8324. --- src/cursordelegate_opengl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cursordelegate_opengl.cpp b/src/cursordelegate_opengl.cpp index f75c4c2d6f..43d555fb54 100644 --- a/src/cursordelegate_opengl.cpp +++ b/src/cursordelegate_opengl.cpp @@ -60,6 +60,9 @@ void CursorDelegateOpenGL::paint(RenderTarget *renderTarget, const QRegion ®i mvp.ortho(QRect(QPoint(0, 0), renderTarget->size())); mvp.translate(cursorRect.x() * scale, cursorRect.y() * scale); + GLFramebuffer *fbo = std::get(renderTarget->nativeHandle()); + GLFramebuffer::pushFramebuffer(fbo); + // Don't need to call GLVertexBuffer::beginFrame() and GLVertexBuffer::endOfFrame() because // the GLVertexBuffer::streamingBuffer() is not being used when painting cursor. glEnable(GL_BLEND); @@ -71,6 +74,8 @@ void CursorDelegateOpenGL::paint(RenderTarget *renderTarget, const QRegion ®i m_cursorTexture->render(region, QRect(0, 0, cursorRect.width(), cursorRect.height()), scale); m_cursorTexture->unbind(); glDisable(GL_BLEND); + + GLFramebuffer::popFramebuffer(); } } // namespace KWin