Don't enlarge the clickable area in non-composited environments with no shadows
svn path=/trunk/KDE/kdebase/workspace/; revision=1009021
This commit is contained in:
parent
345d6f7a7c
commit
1457d3ba32
1 changed files with 21 additions and 21 deletions
|
@ -131,7 +131,7 @@ int OxygenClient::layoutMetric(LayoutMetric lm, bool respectWindowState, const K
|
|||
{
|
||||
bool maximized = isMaximized();
|
||||
// increase the border of the decoration by including the shadow as clickable area
|
||||
int extraBorder = maximized ? 0 : EXTENDED_HITAREA;
|
||||
int extraBorder = (maximized && compositingActive()) ? 0 : EXTENDED_HITAREA;
|
||||
int frameWidth = OxygenFactory::borderSize();
|
||||
|
||||
switch (lm) {
|
||||
|
@ -139,26 +139,26 @@ int OxygenClient::layoutMetric(LayoutMetric lm, bool respectWindowState, const K
|
|||
case LM_BorderRight:
|
||||
case LM_BorderBottom:
|
||||
{
|
||||
if (respectWindowState && maximized) {
|
||||
return 0;
|
||||
} else {
|
||||
int border = 0;
|
||||
if (!(respectWindowState && maximized)) {
|
||||
// Even for thin borders (2px wide) we want to preserve
|
||||
// the rounded corners having a minimum height of 4px
|
||||
if (lm == LM_BorderBottom) {
|
||||
return qMax(frameWidth, 4) + extraBorder;
|
||||
border = qMax(frameWidth, 4);
|
||||
} else {
|
||||
return frameWidth + extraBorder;
|
||||
border = frameWidth;
|
||||
}
|
||||
}
|
||||
return border + extraBorder;
|
||||
}
|
||||
|
||||
case LM_TitleEdgeTop:
|
||||
{
|
||||
if (respectWindowState && maximized) {
|
||||
return 0 + extraBorder;
|
||||
} else {
|
||||
return TFRAMESIZE + extraBorder;
|
||||
int border = 0;
|
||||
if (!(respectWindowState && maximized)) {
|
||||
border = TFRAMESIZE;
|
||||
}
|
||||
return border + extraBorder;
|
||||
}
|
||||
|
||||
case LM_TitleEdgeBottom:
|
||||
|
@ -169,11 +169,11 @@ int OxygenClient::layoutMetric(LayoutMetric lm, bool respectWindowState, const K
|
|||
case LM_TitleEdgeLeft:
|
||||
case LM_TitleEdgeRight:
|
||||
{
|
||||
if (respectWindowState && maximized) {
|
||||
return 0 + extraBorder;
|
||||
} else {
|
||||
return 6 + extraBorder;
|
||||
int border = 0;
|
||||
if (!(respectWindowState && maximized)) {
|
||||
border = 6;
|
||||
}
|
||||
return border + extraBorder;
|
||||
}
|
||||
|
||||
case LM_TitleBorderLeft:
|
||||
|
@ -319,8 +319,9 @@ void OxygenClient::paintEvent(QPaintEvent *e)
|
|||
QColor light = helper_.calcLightColor( color );
|
||||
QColor dark = helper_.calcDarkColor( color );
|
||||
|
||||
bool compositingIsActive = compositingActive();
|
||||
bool maximized = isMaximized();
|
||||
int extraBorder = maximized ? 0 : EXTENDED_HITAREA;
|
||||
int extraBorder = (maximized && compositingIsActive) ? 0 : EXTENDED_HITAREA;
|
||||
|
||||
const int titleHeight = layoutMetric(LM_TitleHeight);
|
||||
const int titleTop = layoutMetric(LM_TitleEdgeTop) + frame.top() - extraBorder;
|
||||
|
@ -336,16 +337,15 @@ void OxygenClient::paintEvent(QPaintEvent *e)
|
|||
|
||||
// draw shadow
|
||||
|
||||
if (compositingActive() && !maximized)
|
||||
if (compositingIsActive && !maximized)
|
||||
shadowTiles(color,KDecoration::options()->color(ColorTitleBar),
|
||||
SHADOW_WIDTH, isActive())->render( frame.adjusted(-SHADOW_WIDTH+4,
|
||||
-SHADOW_WIDTH+4, SHADOW_WIDTH-4, SHADOW_WIDTH-4),
|
||||
&painter, TileSet::Ring);
|
||||
|
||||
// draw window background
|
||||
bool isCompositingActive = compositingActive();
|
||||
|
||||
if (isCompositingActive) {
|
||||
if (compositingIsActive) {
|
||||
frame.getRect(&x, &y, &w, &h);
|
||||
|
||||
QRegion mask(x+5, y+0, w-10, h-0);
|
||||
|
@ -359,7 +359,7 @@ void OxygenClient::paintEvent(QPaintEvent *e)
|
|||
|
||||
helper_.renderWindowBackground(&painter, frame, this->widget(), palette, SHADOW_WIDTH);
|
||||
|
||||
if (isCompositingActive) {
|
||||
if (compositingIsActive) {
|
||||
painter.setClipping(false);
|
||||
}
|
||||
|
||||
|
@ -372,7 +372,7 @@ void OxygenClient::paintEvent(QPaintEvent *e)
|
|||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
// Draw dividing line
|
||||
if (compositingActive()) {
|
||||
if (compositingIsActive) {
|
||||
frame.adjust(-1,-1,1,1);
|
||||
}
|
||||
frame.getRect(&x, &y, &w, &h);
|
||||
|
@ -422,7 +422,7 @@ void OxygenClient::paintEvent(QPaintEvent *e)
|
|||
if(maximized)
|
||||
return;
|
||||
|
||||
helper_.drawFloatFrame(&painter, frame, color, !compositingActive(), isActive(),
|
||||
helper_.drawFloatFrame(&painter, frame, color, !compositingIsActive, isActive(),
|
||||
KDecoration::options()->color(ColorTitleBar));
|
||||
|
||||
if(!isResizable())
|
||||
|
|
Loading…
Reference in a new issue