From 04aa9e9531398a334ca808b9e57ae5ce9b09ca95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 7 Jul 2013 13:57:00 +0200 Subject: [PATCH] rather omit lanczos than capping windows capping shadows is seen as bug (and is ugly and because of the non lanczos transition causes visual flicker) so if the window+shadows extends the buffer, lanczos is simply not possible. BUG: 314838 FIXED-IN: 4.11 REVIEW: 111425 --- lanczosfilter.cpp | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/lanczosfilter.cpp b/lanczosfilter.cpp index 8a20a47d17..4fa09e7dfc 100644 --- a/lanczosfilter.cpp +++ b/lanczosfilter.cpp @@ -184,28 +184,14 @@ void LanczosFilter::performPaint(EffectWindowImpl* w, int mask, QRegion region, init(); const QRect screenRect = Workspace::self()->clientArea(ScreenArea, w->screen(), w->desktop()); // window geometry may not be bigger than screen geometry to fit into the FBO - if (m_shader && w->width() <= screenRect.width() && w->height() <= screenRect.height()) { - double left = 0; - double top = 0; - double right = w->width(); - double bottom = w->height(); - foreach (const WindowQuad & quad, data.quads) { - // we need this loop to include the decoration padding - left = qMin(left, quad.left()); - top = qMin(top, quad.top()); - right = qMax(right, quad.right()); - bottom = qMax(bottom, quad.bottom()); - } - double width = right - left; - double height = bottom - top; - if (width > screenRect.width() || height > screenRect.height()) { - // window with padding does not fit into the framebuffer - // so cut of the shadow - left = 0; - top = 0; - width = w->width(); - height = w->height(); - } + QRect winGeo(w->expandedGeometry()); + if (m_shader && winGeo.width() <= screenRect.width() && winGeo.height() <= screenRect.height()) { + winGeo.translate(-w->geometry().topLeft()); + double left = winGeo.left(); + double top = winGeo.top(); + double width = winGeo.right() - left; + double height = winGeo.bottom() - top; + int tx = data.xTranslation() + w->x() + left * data.xScale(); int ty = data.yTranslation() + w->y() + top * data.yScale(); int tw = width * data.xScale();