From 5d36bab6b2358bfa609345bf8f5378dc22c39159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 3 Dec 2015 13:54:16 +0100 Subject: [PATCH] Move implementation for borderFoo() to AbstractClient Also makes the methods no longer virtual, can just be provided in AbstractClient. --- abstract_client.cpp | 28 ++++++++++------------------ abstract_client.h | 8 ++++---- client.cpp | 12 ------------ client.h | 4 ---- 4 files changed, 14 insertions(+), 38 deletions(-) diff --git a/abstract_client.cpp b/abstract_client.cpp index a5a5e94d54..5264eb09cf 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -1053,25 +1053,17 @@ bool AbstractClient::isActiveFullScreen() const return ac && (ac == this || ac->screen() != screen()); } -int AbstractClient::borderBottom() const -{ - return 0; -} +#define BORDER(which) \ + int AbstractClient::border##which() const \ + { \ + return isDecorated() ? decoration()->border##which() : 0; \ + } -int AbstractClient::borderLeft() const -{ - return 0; -} - -int AbstractClient::borderRight() const -{ - return 0; -} - -int AbstractClient::borderTop() const -{ - return 0; -} +BORDER(Bottom) +BORDER(Left) +BORDER(Right) +BORDER(Top) +#undef BORDER QSize AbstractClient::sizeForClientSize(const QSize &wsize, Sizemode mode, bool noframe) const { diff --git a/abstract_client.h b/abstract_client.h index d8504bcf25..d8384bb9cd 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -626,10 +626,10 @@ protected: // geometry handling void checkOffscreenPosition(QRect *geom, const QRect &screenArea); - virtual int borderLeft() const; - virtual int borderRight() const; - virtual int borderTop() const; - virtual int borderBottom() const; + int borderLeft() const; + int borderRight() const; + int borderTop() const; + int borderBottom() const; virtual void changeMaximize(bool horizontal, bool vertical, bool adjust) = 0; virtual void setGeometryRestore(const QRect &geo) = 0; /** diff --git a/client.cpp b/client.cpp index d2a8b6798e..a9e83abec9 100644 --- a/client.cpp +++ b/client.cpp @@ -2146,18 +2146,6 @@ void Client::showOnScreenEdge() xcb_delete_property(connection(), window(), atoms->kde_screen_edge_show); } -#define BORDER(which) \ - int Client::border##which() const \ - { \ - return isDecorated() ? decoration()->border##which() : 0; \ - } - -BORDER(Bottom) -BORDER(Left) -BORDER(Right) -BORDER(Top) -#undef BORDER - QPointer Client::decoratedClient() const { return m_decoratedClient; diff --git a/client.h b/client.h index 84230e74ca..9912de47a1 100644 --- a/client.h +++ b/client.h @@ -485,10 +485,6 @@ Q_SIGNALS: void maximizeableChanged(bool); private: - int borderLeft() const override; - int borderRight() const override; - int borderTop() const override; - int borderBottom() const override; void exportMappingState(int s); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1 bool isManaged() const; ///< Returns false if this client is not yet managed void updateAllowedActions(bool force = false);