From f0492f9b029f9496bfa1eb0595371fffbd1505e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 13 Jul 2011 22:50:31 +0200 Subject: [PATCH] fix shadow fix (cherry picked from commit 55986b32de9e5f5f66ac0c3448b26863cfc2dee0) --- client.h | 1 - composite.cpp | 15 +-------------- deleted.cpp | 7 ++++++- deleted.h | 1 - toplevel.cpp | 8 ++++++++ toplevel.h | 5 ----- 6 files changed, 15 insertions(+), 22 deletions(-) diff --git a/client.h b/client.h index 6181ef3777..fca0297ee0 100644 --- a/client.h +++ b/client.h @@ -419,7 +419,6 @@ public: WindowRelative // Relative to the top left corner of the window }; void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom, CoordinateMode mode) const; - virtual void addRepaintFull(); TabBox::TabBoxClientImpl* tabBoxClient() const { return m_tabBoxClient; diff --git a/composite.cpp b/composite.cpp index 1e7a69817e..43078fb7d6 100644 --- a/composite.cpp +++ b/composite.cpp @@ -750,10 +750,7 @@ void Toplevel::addRepaint(int x, int y, int w, int h) void Toplevel::addRepaintFull() { - repaints_region = rect(); - if (hasShadow()) { - repaints_region = repaints_region.united(shadow()->shadowRegion()); - } + repaints_region = decorationRect(); workspace()->checkCompositeTimer(); } @@ -842,11 +839,6 @@ bool Client::shouldUnredirect() const return false; } -void Client::addRepaintFull() -{ - repaints_region = decorationRect(); - workspace()->checkCompositeTimer(); -} //**************************************** // Unmanaged @@ -885,10 +877,5 @@ bool Deleted::shouldUnredirect() const return false; } -void Deleted::addRepaintFull() -{ - repaints_region = decorationRect(); - workspace()->checkCompositeTimer(); -} } // namespace diff --git a/deleted.cpp b/deleted.cpp index e6130ffa20..f46515923a 100644 --- a/deleted.cpp +++ b/deleted.cpp @@ -22,6 +22,7 @@ along with this program. If not, see . #include "workspace.h" #include "client.h" +#include "shadow.h" namespace KWin { @@ -139,7 +140,11 @@ void Deleted::layoutDecorationRects(QRect& left, QRect& top, QRect& right, QRect QRect Deleted::decorationRect() const { - return rect().adjusted(-padding_left, -padding_top, padding_top, padding_bottom); + QRect r(rect()); + r.adjust(-padding_left, -padding_top, padding_top, padding_bottom); + if (hasShadow()) + r |= shadow()->shadowRegion().boundingRect(); + return r; } QRect Deleted::transparentRect() const diff --git a/deleted.h b/deleted.h index 3b0341ae02..1f98aaf9de 100644 --- a/deleted.h +++ b/deleted.h @@ -57,7 +57,6 @@ public: return no_border; } void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) const; - virtual void addRepaintFull(); // in composite.cpp QRect decorationRect() const; protected: virtual void debug(QDebug& stream) const; diff --git a/toplevel.cpp b/toplevel.cpp index c0d3370baa..e0547a2fac 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -98,6 +98,14 @@ QDebug& operator<<(QDebug& stream, const ConstToplevelList& list) return stream; } +QRect Toplevel::decorationRect() const +{ + QRect r(rect()); + if (hasShadow()) + r |= shadow()->shadowRegion().boundingRect(); + return r; +} + void Toplevel::detectShape(Window id) { is_shape = Extensions::hasShape(id); diff --git a/toplevel.h b/toplevel.h index d63d106386..9ad7dbaa78 100644 --- a/toplevel.h +++ b/toplevel.h @@ -285,11 +285,6 @@ inline QRect Toplevel::rect() const return QRect(0, 0, width(), height()); } -inline QRect Toplevel::decorationRect() const -{ - return rect(); -} - inline QRegion Toplevel::decorationPendingRegion() const { return QRegion();