From c29c437e580026696d63aa82f083b020cb7c13b8 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 21 Sep 2021 14:32:35 +0300 Subject: [PATCH] effects/glide: Adjust the effect to projection matrix changes With per-screen rendering, the projection matrix is no longer created with the workspace geometry, i.e. all screen geometries united, so the center of the workspace geometry may not map to (0, 0) in the clip coordinates. GLRenderTarget::virtualScreenGeometry() can be used to query the rect that was used to create the projection matrix. BUG: 442770 --- src/effects/glide/glide.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/effects/glide/glide.cpp b/src/effects/glide/glide.cpp index e877a0aeeb..5491c2591f 100644 --- a/src/effects/glide/glide.cpp +++ b/src/effects/glide/glide.cpp @@ -12,6 +12,7 @@ // own #include "glide.h" +#include "kwinglutils.h" // KConfigSkeleton #include "glideconfig.h" @@ -120,7 +121,7 @@ void GlideEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowP data.setProjectionMatrix(invOffsetMatrix * oldProjMatrix); // Move the center of the window to the origin. - const QRectF screenGeo = effects->virtualScreenGeometry(); + const QRectF screenGeo = GLRenderTarget::virtualScreenGeometry(); const QPointF offset = screenGeo.center() - windowGeo.center(); data.translate(offset.x(), offset.y());