From c1053ce1a54f7786a129a2516290cd265aaa3b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 3 Dec 2015 13:48:54 +0100 Subject: [PATCH] Add a base implementation for layoutDecorationRects to AbstractClient --- abstract_client.cpp | 16 ++++++++++++++++ abstract_client.h | 1 + client.h | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/abstract_client.cpp b/abstract_client.cpp index c2b9ea8910..a5a5e94d54 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -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()); +} + } diff --git a/abstract_client.h b/abstract_client.h index 4fe5a67af8..d8504bcf25 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -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); diff --git a/client.h b/client.h index a1a2f10921..84230e74ca 100644 --- a/client.h +++ b/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);