Add a base implementation for layoutDecorationRects to AbstractClient

icc-effect-5.14.5
Martin Gräßlin 2015-12-03 13:48:54 +01:00
parent 1659c0b641
commit c1053ce1a5
3 changed files with 18 additions and 1 deletions

View File

@ -1329,4 +1329,20 @@ void AbstractClient::triggerDecorationRepaint()
}
}
void AbstractClient::layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) const
{
if (!isDecorated()) {
return;
}
QRect r = decoration()->rect();
top = QRect(r.x(), r.y(), r.width(), borderTop());
bottom = QRect(r.x(), r.y() + r.height() - borderBottom(),
r.width(), borderBottom());
left = QRect(r.x(), r.y() + top.height(),
borderLeft(), r.height() - top.height() - bottom.height());
right = QRect(r.x() + r.width() - borderRight(), r.y() + top.height(),
borderRight(), r.height() - top.height() - bottom.height());
}
}

View File

@ -497,6 +497,7 @@ public:
}
bool decorationHasAlpha() const;
void triggerDecorationRepaint();
virtual void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) const;
// TODO: remove boolean trap
static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false);

View File

@ -356,7 +356,7 @@ public:
bool isClientSideDecorated() const;
bool wantsShadowToBeRendered() const override;
void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) const;
void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) const override;
Xcb::Property fetchFirstInTabBox() const;
void readFirstInTabBox(Xcb::Property &property);