From 038aa9d8d7effc2170d66b5d12c25d704ebcaa46 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 27 Nov 2020 13:59:48 +0000 Subject: [PATCH] wayland: Fix clipped thumbnails of client-side decorated apps The buffer offset for client-side decorated windows is not 0, this plus mixing the frame position and the client size may result in clipped thumbnails of client-side decorated applications, such as gedit, etc. BUG: 428595 (cherry picked from commit e298caaa7ac8c9d3853929492770ced55faf0818) --- plugins/scenes/opengl/scene_opengl.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp index d91d062985..281d24d8fe 100644 --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -1551,7 +1551,7 @@ QSharedPointer OpenGLWindow::windowTexture() return QSharedPointer(new GLTexture(*frame->texture())); } else { auto effectWindow = window()->effectWindow(); - QRect geo(pos(), window()->clientSize()); + const QRect geo = window()->clientGeometry(); QSharedPointer texture(new GLTexture(GL_RGBA8, geo.size())); QScopedPointer framebuffer(new KWin::GLRenderTarget(*texture)); @@ -1562,14 +1562,10 @@ QSharedPointer OpenGLWindow::windowTexture() GLRenderTarget::setVirtualScreenGeometry(geo); QMatrix4x4 mvp; - mvp.ortho(geo); + mvp.ortho(geo.x(), geo.x() + geo.width(), geo.y(), geo.y() + geo.height(), -1, 1); WindowPaintData data(effectWindow); data.setProjectionMatrix(mvp); - QSizeF size(geo.size()); - data.setYScale(-1); - data.setXTranslation(bufferOffset().x()); - data.setYTranslation(geo.height() + bufferOffset().y()); performPaint(Scene::PAINT_WINDOW_TRANSFORMED | Scene::PAINT_WINDOW_LANCZOS, geo, data); GLRenderTarget::popRenderTarget();