diff --git a/abstract_client.cpp b/abstract_client.cpp index 143b27c635..a49788e537 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -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; +} + } diff --git a/abstract_client.h b/abstract_client.h index ba57f680f5..cc4fc84e6a 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -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; diff --git a/client.h b/client.h index 451e5157e1..6698be4000 100644 --- a/client.h +++ b/client.h @@ -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.