fix shadow fix

(cherry picked from commit 55986b32de9e5f5f66ac0c3448b26863cfc2dee0)
This commit is contained in:
Thomas Lübking 2011-07-13 22:50:31 +02:00
parent de0a1406a0
commit f0492f9b02
6 changed files with 15 additions and 22 deletions

View file

@ -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;

View file

@ -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

View file

@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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

View file

@ -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;

View file

@ -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);

View file

@ -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();