Move implementation for borderFoo() to AbstractClient

Also makes the methods no longer virtual, can just be provided in
AbstractClient.
This commit is contained in:
Martin Gräßlin 2015-12-03 13:54:16 +01:00
parent a82daabfe9
commit 5d36bab6b2
4 changed files with 14 additions and 38 deletions

View file

@ -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
{

View file

@ -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;
/**

View file

@ -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<Decoration::DecoratedClientImpl> Client::decoratedClient() const
{
return m_decoratedClient;

View file

@ -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);