From 9cafbb117984f746d4b71213effc3d27e1435f36 Mon Sep 17 00:00:00 2001 From: Kamil Piwowarski <9luty1992@gmail.com> Date: Thu, 26 Oct 2017 18:36:03 +0100 Subject: [PATCH] Fix viewport for screenshot on multiple screens Summary: D8479 fixes viewport for real hardware, but there is still problem with screenshots. This patch fixes that. Test Plan: - Have three monitors (like in bug 385655) - Press PrtSc and then Enter - Screenshot is ok Before: {F5450056} After: {F5450058} Reviewers: #kwin, #plasma, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: davidedmundson, plasma-devel, kwin, #kwin Tags: #plasma Differential Revision: https://phabricator.kde.org/D8485 --- libkwineffects/kwinglutils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libkwineffects/kwinglutils.cpp b/libkwineffects/kwinglutils.cpp index fb7d75ed1f..8d1d0eb65d 100644 --- a/libkwineffects/kwinglutils.cpp +++ b/libkwineffects/kwinglutils.cpp @@ -1256,9 +1256,9 @@ void GLRenderTarget::blitFromFramebuffer(const QRect &source, const QRect &desti const QRect d = destination.isNull() ? QRect(0, 0, mTexture.width(), mTexture.height()) : destination; glBlitFramebuffer((s.x() - s_virtualScreenGeometry.x()) * s_virtualScreenScale, - (s_virtualScreenGeometry.height() - s_virtualScreenGeometry.y() - s.y() - s.height()) * s_virtualScreenScale, + (s_virtualScreenGeometry.height() - s_virtualScreenGeometry.y() + s.y() - s.height()) * s_virtualScreenScale, (s.x() - s_virtualScreenGeometry.x() + s.width()) * s_virtualScreenScale, - (s_virtualScreenGeometry.height() - s_virtualScreenGeometry.y() - s.y()) * s_virtualScreenScale, + (s_virtualScreenGeometry.height() - s_virtualScreenGeometry.y() + s.y()) * s_virtualScreenScale, d.x(), mTexture.height() - d.y() - d.height(), d.x() + d.width(), mTexture.height() - d.y(), GL_COLOR_BUFFER_BIT, filter); GLRenderTarget::popRenderTarget();