From 7c49b1ca42224b7f1f659b6d55e09f00a4ae1a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 13 Oct 2015 09:49:31 +0200 Subject: [PATCH] Add sizeForClientSize as virtual method to AbstractClient Base implementation returns the passed in size. Required for moving adjustedSize to AbstractClient. --- abstract_client.cpp | 7 +++++++ abstract_client.h | 8 ++++++++ client.h | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) 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.