Fix shaded and shaped windows not being clipped correctly.

BUG: 193808

svn path=/trunk/KDE/kdebase/workspace/; revision=973673
This commit is contained in:
Fredrik Höglund 2009-05-27 16:04:58 +00:00
parent e6f63229ac
commit f81485d868
2 changed files with 10 additions and 6 deletions

View file

@ -233,7 +233,7 @@ void Scene::paintSimpleScreen( int orig_mask, QRegion region )
w->resetPaintingEnabled();
data.paint = region;
// Clip out the decoration for opaque windows; the decoration is drawn in the second pass
data.clip = w->isOpaque() ? QRegion(w->clientRect().translated( w->x(), w->y())) : QRegion();
data.clip = w->isOpaque() ? w->clientShape().translated( w->x(), w->y() ) : QRegion();
data.quads = w->buildQuads();
// preparation step
effects->prePaintWindow( effectWindow( w ), data, time_diff );
@ -410,10 +410,14 @@ QRegion Scene::Window::shape() const
return shape_region;
}
// Returns the rectangle occupied by the client within the window geometry
QRect Scene::Window::clientRect() const
QRegion Scene::Window::clientShape() const
{
return QRect(toplevel->clientPos(), toplevel->clientSize());
Client *c = dynamic_cast< Client* >( toplevel );
if ( c && c->isShade() )
return QRegion();
const QRegion r = shape() & QRect( toplevel->clientPos(), toplevel->clientSize() );
return r.isEmpty() ? QRegion() : r;
}
bool Scene::Window::isVisible() const
@ -477,7 +481,7 @@ WindowQuadList Scene::Window::buildQuads( bool force ) const
else
{
Client *client = static_cast<Client*>( toplevel );
QRegion contents = shape() & QRect( toplevel->clientPos(), toplevel->clientSize());
QRegion contents = clientShape();
QRegion decoration = (Workspace::self()->decorationHasAlpha() ?
QRegion(client->decorationRect()) : shape()) - contents;
ret = makeQuads( WindowQuadContents, contents );

View file

@ -186,7 +186,7 @@ class Scene::Window
bool isOpaque() const;
// shape of the window
QRegion shape() const;
QRect clientRect() const;
QRegion clientShape() const;
void discardShape();
void updateToplevel( Toplevel* c );
// creates initial quad list for the window