diff --git a/abstract_client.cpp b/abstract_client.cpp index c073f6ae15..df367a9f80 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -448,4 +448,14 @@ void AbstractClient::keepInArea(QRect area, bool partial) move(tx, ty); } +QSize AbstractClient::maxSize() const +{ + return rules()->checkMaxSize(QSize(INT_MAX, INT_MAX)); +} + +QSize AbstractClient::minSize() const +{ + return rules()->checkMinSize(QSize(0, 0)); +} + } diff --git a/abstract_client.h b/abstract_client.h index 27eaf9f411..7034d4d4b3 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -131,6 +131,14 @@ class AbstractClient : public Toplevel * To read only the caption as provided by WM_NAME, use the getter with an additional @c false value. **/ Q_PROPERTY(QString caption READ caption NOTIFY captionChanged) + /** + * Minimum size as specified in WM_NORMAL_HINTS + **/ + Q_PROPERTY(QSize minSize READ minSize) + /** + * Maximum size as specified in WM_NORMAL_HINTS + **/ + Q_PROPERTY(QSize maxSize READ maxSize) public: virtual ~AbstractClient(); @@ -311,6 +319,8 @@ public: virtual void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) = 0; void resizeWithChecks(const QSize& s, ForceGeometry_t force = NormalGeometrySet); void keepInArea(QRect area, bool partial = false); + virtual QSize minSize() const; + virtual QSize maxSize() const; // TODO: remove boolean trap static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false); diff --git a/client.h b/client.h index f2522494fa..10a5c94a8c 100644 --- a/client.h +++ b/client.h @@ -164,14 +164,6 @@ class Client * The "Window Tabs" Group this Client belongs to. **/ Q_PROPERTY(KWin::TabGroup* tabGroup READ tabGroup NOTIFY tabGroupChanged SCRIPTABLE false) - /** - * Minimum size as specified in WM_NORMAL_HINTS - **/ - Q_PROPERTY(QSize minSize READ minSize) - /** - * Maximum size as specified in WM_NORMAL_HINTS - **/ - Q_PROPERTY(QSize maxSize READ maxSize) /** * Whether the window has a decoration or not. * This property is not allowed to be set by applications themselves. @@ -229,8 +221,8 @@ public: bool hasNETSupport() const; - QSize minSize() const; - QSize maxSize() const; + QSize minSize() const override; + QSize maxSize() const override; QSize basicUnit() const; virtual QPoint clientPos() const; // Inside of geometry() virtual QSize clientSize() const;