Always respect the cornerShape(). Fixes a minor visual glitch when a shaped
window is mapped next to a screen edge. BUG: 197516 svn path=/trunk/KDE/kdebase/workspace/; revision=1024877
This commit is contained in:
parent
9bfb085232
commit
a26a08830d
1 changed files with 5 additions and 34 deletions
|
@ -862,42 +862,13 @@ void KCommonDecoration::updateWindowShape()
|
||||||
int w = widget()->width();
|
int w = widget()->width();
|
||||||
int h = widget()->height();
|
int h = widget()->height();
|
||||||
|
|
||||||
bool tl=true,tr=true,bl=true,br=true; // is there a transparent rounded corner in top-left? etc
|
|
||||||
|
|
||||||
// no transparent rounded corners if this window corner lines up with a screen corner
|
|
||||||
for(int screen=0; screen < Kephal::ScreenUtils::numScreens(); ++screen)
|
|
||||||
{
|
|
||||||
QRect fullscreen(Kephal::ScreenUtils::screenGeometry(screen));
|
|
||||||
QRect window = geometry();
|
|
||||||
|
|
||||||
if(window.topLeft() == fullscreen.topLeft() ) tl = false;
|
|
||||||
if(window.topRight() == fullscreen.topRight() ) tr = false;
|
|
||||||
if(window.bottomLeft() == fullscreen.bottomLeft() ) bl = false;
|
|
||||||
if(window.bottomRight()== fullscreen.bottomRight() ) br = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
QRegion mask(0, 0, w, h);
|
QRegion mask(0, 0, w, h);
|
||||||
|
|
||||||
// Remove top-left corner.
|
// Remove corners (if subclass wants to.)
|
||||||
if(tl)
|
mask -= cornerShape(WC_TopLeft);
|
||||||
{
|
mask -= cornerShape(WC_TopRight);
|
||||||
mask -= cornerShape(WC_TopLeft);
|
mask -= cornerShape(WC_BottomLeft);
|
||||||
}
|
mask -= cornerShape(WC_BottomRight);
|
||||||
// Remove top-right corner.
|
|
||||||
if(tr)
|
|
||||||
{
|
|
||||||
mask -= cornerShape(WC_TopRight);
|
|
||||||
}
|
|
||||||
// Remove top-left corner.
|
|
||||||
if(bl)
|
|
||||||
{
|
|
||||||
mask -= cornerShape(WC_BottomLeft);
|
|
||||||
}
|
|
||||||
// Remove top-right corner.
|
|
||||||
if(br)
|
|
||||||
{
|
|
||||||
mask -= cornerShape(WC_BottomRight);
|
|
||||||
}
|
|
||||||
|
|
||||||
setMask( mask );
|
setMask( mask );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue