Add sizeForClientSize as virtual method to AbstractClient

Base implementation returns the passed in size.

Required for moving adjustedSize to AbstractClient.
This commit is contained in:
Martin Gräßlin 2015-10-13 09:49:31 +02:00
parent 37fc20d3c0
commit 7c49b1ca42
3 changed files with 16 additions and 1 deletions

View file

@ -1028,4 +1028,11 @@ int AbstractClient::borderTop() const
return 0;
}
QSize AbstractClient::sizeForClientSize(const QSize &wsize, Sizemode mode, bool noframe) const
{
Q_UNUSED(mode)
Q_UNUSED(noframe)
return wsize;
}
}

View file

@ -404,6 +404,14 @@ public:
SizemodeFixedH, ///< Try not to affect height
SizemodeMax ///< Try not to make it larger in either direction
};
/**
*Calculate the appropriate frame size for the given client size @p wsize.
*
* @p wsize is adapted according to the window's size hints (minimum, maximum and incremental size changes).
*
* Default implementation returns the passed in @p wsize.
*/
virtual QSize sizeForClientSize(const QSize &wsize, Sizemode mode = SizemodeAny, bool noframe = false) const;
virtual bool hasStrut() const;

View file

@ -286,7 +286,7 @@ public:
void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override;
void resizeWithChecks(int w, int h, xcb_gravity_t gravity, ForceGeometry_t force = NormalGeometrySet);
void resizeWithChecks(const QSize& s, xcb_gravity_t gravity, ForceGeometry_t force = NormalGeometrySet);
QSize sizeForClientSize(const QSize&, Sizemode mode = SizemodeAny, bool noframe = false) const;
QSize sizeForClientSize(const QSize&, Sizemode mode = SizemodeAny, bool noframe = false) const override;
/** Set the quick tile mode ("snap") of this window.
* This will also handle preserving and restoring of window geometry as necessary.