From 95505eb0443978328c5097c2cbb94e29901494b8 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Sat, 26 Mar 2022 10:21:03 +0100 Subject: [PATCH] Adapt to OpenGL related Qt6 QQuickWindow API changes --- src/libkwineffects/kwinoffscreenquickview.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libkwineffects/kwinoffscreenquickview.cpp b/src/libkwineffects/kwinoffscreenquickview.cpp index acd81ec39f..b18af17f40 100644 --- a/src/libkwineffects/kwinoffscreenquickview.cpp +++ b/src/libkwineffects/kwinoffscreenquickview.cpp @@ -27,6 +27,8 @@ #include #include #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#include #include // for QMutableEventPoint #endif @@ -267,7 +269,11 @@ void OffscreenQuickView::update() return; } } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) d->m_view->setRenderTarget(d->m_fbo.data()); +#else + d->m_view->setRenderTarget(QQuickRenderTarget::fromOpenGLTexture(d->m_fbo->texture(), d->m_fbo->size())); +#endif } d->m_renderControl->polishItems(); @@ -275,7 +281,11 @@ void OffscreenQuickView::update() d->m_renderControl->render(); if (usingGl) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) d->m_view->resetOpenGLState(); +#else + QQuickOpenGLUtils::resetOpenGLState(); +#endif } if (d->m_useBlit) {