From 74ff3bf0823c9a77410ce4b3827f3cd35e458763 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 4 Aug 2022 14:12:41 +0200 Subject: [PATCH] Account for render target scale when rendering a WindowThumbnailItem Otherwise we get too large and cut off window thumbnails. --- src/scripting/windowthumbnailitem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scripting/windowthumbnailitem.cpp b/src/scripting/windowthumbnailitem.cpp index ba25ff202b..0cb3d721bd 100644 --- a/src/scripting/windowthumbnailitem.cpp +++ b/src/scripting/windowthumbnailitem.cpp @@ -433,9 +433,11 @@ void WindowThumbnailItem::updateOffscreenTexture() glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); + auto scale = Compositor::self()->scene()->renderTargetScale(); + QMatrix4x4 projectionMatrix; - projectionMatrix.ortho(geometry.x(), geometry.x() + geometry.width(), - geometry.y(), geometry.y() + geometry.height(), -1, 1); + projectionMatrix.ortho(geometry.x() * scale, (geometry.x() + geometry.width()) * scale, + geometry.y() * scale, (geometry.y() + geometry.height()) * scale, -1, 1); WindowPaintData data; data.setProjectionMatrix(projectionMatrix);