diff --git a/src/scripting/windowthumbnailitem.cpp b/src/scripting/windowthumbnailitem.cpp index ba639f74d1..ba25ff202b 100644 --- a/src/scripting/windowthumbnailitem.cpp +++ b/src/scripting/windowthumbnailitem.cpp @@ -164,11 +164,17 @@ void WindowThumbnailItem::updateFrameRenderingConnection() return; } - if (Compositor::self()->backend()->compositingType() == OpenGLCompositing) { + if (useGlThumbnails()) { m_frameRenderingConnection = connect(Compositor::self()->scene(), &Scene::preFrameRender, this, &WindowThumbnailItem::updateOffscreenTexture); } } +bool WindowThumbnailItem::useGlThumbnails() +{ + static bool qtQuickIsSoftware = QStringList({QStringLiteral("software"), QStringLiteral("softwarecontext")}).contains(QQuickWindow::sceneGraphBackend()); + return Compositor::self()->backend()->compositingType() == OpenGLCompositing && !qtQuickIsSoftware; +} + QSize WindowThumbnailItem::sourceSize() const { return m_sourceSize; @@ -188,7 +194,7 @@ void WindowThumbnailItem::destroyOffscreenTexture() if (!Compositor::compositing()) { return; } - if (Compositor::self()->backend()->compositingType() != OpenGLCompositing) { + if (!useGlThumbnails()) { return; } diff --git a/src/scripting/windowthumbnailitem.h b/src/scripting/windowthumbnailitem.h index 73bf7ee373..251fe03c8c 100644 --- a/src/scripting/windowthumbnailitem.h +++ b/src/scripting/windowthumbnailitem.h @@ -87,6 +87,7 @@ private: void destroyOffscreenTexture(); void updateImplicitSize(); void updateFrameRenderingConnection(); + static bool useGlThumbnails(); QSize m_sourceSize; QUuid m_wId;