summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2013-01-09 09:09:39 (GMT)
committerMartin Gräßlin <mgraesslin@kde.org>2013-01-11 07:51:20 (GMT)
commit27172bbcc07d883ff765b1198778178eb58627a4 (patch)
tree053ecab710bdf3233dfe971d32749e2ac2aa73b7
parente448aeb49efb031d93ce3fcefcca9c01fb920697 (diff)
Track painted areas in Thumbnail Aside effect
Following the approach of ShowPaint effect by tracking the actual painted regions per window to determine whether the painted area intersects with one of the thumbnails. BUG: 306169 FIXED-IN: 4.10 REVIEW: 108289
-rw-r--r--kwin/effects/thumbnailaside/thumbnailaside.cpp9
-rw-r--r--kwin/effects/thumbnailaside/thumbnailaside.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/kwin/effects/thumbnailaside/thumbnailaside.cpp b/kwin/effects/thumbnailaside/thumbnailaside.cpp
index 90db31f..2a1f557 100644
--- a/kwin/effects/thumbnailaside/thumbnailaside.cpp
+++ b/kwin/effects/thumbnailaside/thumbnailaside.cpp
@@ -57,9 +57,10 @@ void ThumbnailAsideEffect::reconfigure(ReconfigureFlags)
void ThumbnailAsideEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data)
{
+ painted = QRegion();
effects->paintScreen(mask, region, data);
foreach (const Data & d, windows) {
- if (region.contains(d.rect)) {
+ if (painted.intersects(d.rect)) {
WindowPaintData data(d.window);
data.multiplyOpacity(opacity);
QRect region;
@@ -70,6 +71,12 @@ void ThumbnailAsideEffect::paintScreen(int mask, QRegion region, ScreenPaintData
}
}
+void ThumbnailAsideEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data)
+{
+ effects->paintWindow(w, mask, region, data);
+ painted |= region;
+}
+
void ThumbnailAsideEffect::slotWindowDamaged(EffectWindow* w, const QRect&)
{
foreach (const Data & d, windows) {
diff --git a/kwin/effects/thumbnailaside/thumbnailaside.h b/kwin/effects/thumbnailaside/thumbnailaside.h
index 841f462..98f6544 100644
--- a/kwin/effects/thumbnailaside/thumbnailaside.h
+++ b/kwin/effects/thumbnailaside/thumbnailaside.h
@@ -47,6 +47,7 @@ public:
ThumbnailAsideEffect();
virtual void reconfigure(ReconfigureFlags);
virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
+ virtual void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data);
// for properties
int configuredMaxWidth() const {
@@ -82,6 +83,7 @@ private:
int spacing;
double opacity;
int screen;
+ QRegion painted;
};
} // namespace