From df1499784f4e28303762a39b922461d4f70e643e Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 21 May 2015 14:59:27 +0100 Subject: [PATCH] move isFullScreenable to AbstractClient REVIEW: 123871 --- abstract_client.h | 13 +++++++++++++ client.h | 15 ++------------- geometry.cpp | 5 +++++ shell_client.cpp | 5 +++++ shell_client.h | 1 + 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/abstract_client.h b/abstract_client.h index 244ca213d8..42511e62cb 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -44,6 +44,17 @@ class DecorationPalette; class AbstractClient : public Toplevel { Q_OBJECT + /** + * Whether this Client is fullScreen. A Client might either be fullScreen due to the _NET_WM property + * or through a legacy support hack. The fullScreen state can only be changed if the Client does not + * use the legacy hack. To be sure whether the state changed, connect to the notify signal. + **/ + Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen NOTIFY fullScreenChanged) + /** + * Whether the Client can be set to fullScreen. The property is evaluated each time it is invoked. + * Because of that there is no notify signal. + **/ + Q_PROPERTY(bool fullScreenable READ isFullScreenable) /** * Whether this Client is the currently visible Client in its Client Group (Window Tabs). * For change connect to the visibleChanged signal on the Client's Group. @@ -176,6 +187,7 @@ public: virtual bool isCloseable() const = 0; // TODO: remove boolean trap virtual bool isShown(bool shaded_is_shown) const = 0; + virtual bool isFullScreenable() const = 0; virtual bool isFullScreen() const = 0; // TODO: remove boolean trap virtual AbstractClient *findModal(bool allow_itself = false) = 0; @@ -300,6 +312,7 @@ public Q_SLOTS: virtual void closeWindow() = 0; Q_SIGNALS: + void fullScreenChanged(); void skipSwitcherChanged(); void iconChanged(); void activeChanged(); diff --git a/client.h b/client.h index a8684937bb..454dc887c4 100644 --- a/client.h +++ b/client.h @@ -75,17 +75,6 @@ class Client : public AbstractClient { Q_OBJECT - /** - * Whether this Client is fullScreen. A Client might either be fullScreen due to the _NET_WM property - * or through a legacy support hack. The fullScreen state can only be changed if the Client does not - * use the legacy hack. To be sure whether the state changed, connect to the notify signal. - **/ - Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen NOTIFY fullScreenChanged) - /** - * Whether the Client can be set to fullScreen. The property is evaluated each time it is invoked. - * Because of that there is no notify signal. - **/ - Q_PROPERTY(bool fullScreenable READ isFullScreenable) /** * The geometry of this Client. Be aware that depending on resize mode the geometryChanged signal * might be emitted at each resize step or only at the end of the resize operation. @@ -295,7 +284,8 @@ public: void setFullScreen(bool set, bool user = true) override; bool isFullScreen() const override; - bool isFullScreenable(bool fullscreen_hack = false) const; + bool isFullScreenable() const override; + bool isFullScreenable(bool fullscreen_hack) const; bool isActiveFullScreen() const; bool userCanSetFullScreen() const override; QRect geometryFSRestore() const { @@ -588,7 +578,6 @@ Q_SIGNALS: void clientStartUserMovedResized(KWin::Client*); void clientStepUserMovedResized(KWin::Client *, const QRect&); void clientFinishUserMovedResized(KWin::Client*); - void fullScreenChanged(); void transientChanged(); void modalChanged(); void moveResizedChanged(); diff --git a/geometry.cpp b/geometry.cpp index dd2df6244e..40339fa0b6 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2342,6 +2342,11 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust) emit quickTileModeChanged(); } +bool Client::isFullScreenable() const +{ + return isFullScreenable(false); +} + bool Client::isFullScreenable(bool fullscreen_hack) const { if (!rules()->checkFullScreen(true)) diff --git a/shell_client.cpp b/shell_client.cpp index 0cee5573be..62d6caef50 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -214,6 +214,11 @@ bool ShellClient::isCloseable() const return false; } +bool ShellClient::isFullScreenable() const +{ + return false; +} + bool ShellClient::isFullScreen() const { return false; diff --git a/shell_client.h b/shell_client.h index 5d165fe221..31142b8431 100644 --- a/shell_client.h +++ b/shell_client.h @@ -62,6 +62,7 @@ public: void closeWindow() override; AbstractClient *findModal(bool allow_itself = false) override; bool isCloseable() const override; + bool isFullScreenable() const override; bool isFullScreen() const override; bool isMaximizable() const override; bool isMinimizable() const override;