Fix shaded and shaped windows not being clipped correctly.
BUG: 193808 svn path=/trunk/KDE/kdebase/workspace/; revision=973673
This commit is contained in:
parent
e6f63229ac
commit
f81485d868
2 changed files with 10 additions and 6 deletions
14
scene.cpp
14
scene.cpp
|
@ -233,7 +233,7 @@ void Scene::paintSimpleScreen( int orig_mask, QRegion region )
|
||||||
w->resetPaintingEnabled();
|
w->resetPaintingEnabled();
|
||||||
data.paint = region;
|
data.paint = region;
|
||||||
// Clip out the decoration for opaque windows; the decoration is drawn in the second pass
|
// 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();
|
data.quads = w->buildQuads();
|
||||||
// preparation step
|
// preparation step
|
||||||
effects->prePaintWindow( effectWindow( w ), data, time_diff );
|
effects->prePaintWindow( effectWindow( w ), data, time_diff );
|
||||||
|
@ -410,10 +410,14 @@ QRegion Scene::Window::shape() const
|
||||||
return shape_region;
|
return shape_region;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the rectangle occupied by the client within the window geometry
|
QRegion Scene::Window::clientShape() const
|
||||||
QRect Scene::Window::clientRect() 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
|
bool Scene::Window::isVisible() const
|
||||||
|
@ -477,7 +481,7 @@ WindowQuadList Scene::Window::buildQuads( bool force ) const
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Client *client = static_cast<Client*>( toplevel );
|
Client *client = static_cast<Client*>( toplevel );
|
||||||
QRegion contents = shape() & QRect( toplevel->clientPos(), toplevel->clientSize());
|
QRegion contents = clientShape();
|
||||||
QRegion decoration = (Workspace::self()->decorationHasAlpha() ?
|
QRegion decoration = (Workspace::self()->decorationHasAlpha() ?
|
||||||
QRegion(client->decorationRect()) : shape()) - contents;
|
QRegion(client->decorationRect()) : shape()) - contents;
|
||||||
ret = makeQuads( WindowQuadContents, contents );
|
ret = makeQuads( WindowQuadContents, contents );
|
||||||
|
|
2
scene.h
2
scene.h
|
@ -186,7 +186,7 @@ class Scene::Window
|
||||||
bool isOpaque() const;
|
bool isOpaque() const;
|
||||||
// shape of the window
|
// shape of the window
|
||||||
QRegion shape() const;
|
QRegion shape() const;
|
||||||
QRect clientRect() const;
|
QRegion clientShape() const;
|
||||||
void discardShape();
|
void discardShape();
|
||||||
void updateToplevel( Toplevel* c );
|
void updateToplevel( Toplevel* c );
|
||||||
// creates initial quad list for the window
|
// creates initial quad list for the window
|
||||||
|
|
Loading…
Reference in a new issue