From cd1f1ce6234ffa594258f53653510370786a7302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Fri, 12 Mar 2010 16:47:45 +0000 Subject: [PATCH] Only blur the area below the window decoration if the application hasn't set the _KDE_NET_WM_BLUR_REGION hint. svn path=/trunk/KDE/kdebase/workspace/; revision=1102480 --- effects/blur/blur.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp index 356a2040e2..147fdab079 100644 --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -84,7 +84,13 @@ void BlurEffect::updateBlurRegion(EffectWindow *w) const } } - w->setData(BlurRegionRole, value.isNull() ? QVariant() : region); + if (region.isEmpty() && !value.isNull()) { + // Set the data to a dummy value. + // This is needed to be able to distinguish between the value not + // being set, and being set to an empty region. + w->setData(BlurRegionRole, 1); + } else + w->setData(BlurRegionRole, region); } void BlurEffect::windowAdded(EffectWindow *w) @@ -133,15 +139,22 @@ QRegion BlurEffect::blurRegion(const EffectWindow *w) const if (!appRegion.isEmpty()) { if (w->hasDecoration()) { region = w->shape(); - region -= w->contentsRect(); + region -= w->decorationInnerRect(); region |= appRegion.translated(w->contentsRect().topLeft()) & w->contentsRect(); } else region = appRegion & w->contentsRect(); - } else + } else { + // An empty region means that the blur effect should be enabled + // for the whole window. region = w->shape(); - } else + } + } else if (w->hasDecoration()) { + // If the client hasn't specified a blur region, we'll only enable + // the effect behind the decoration. region = w->shape(); + region -= w->decorationInnerRect(); + } return region; }