Add a base implementation for layoutDecorationRects to AbstractClient
This commit is contained in:
parent
1659c0b641
commit
c1053ce1a5
3 changed files with 18 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
2
client.h
2
client.h
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue