diff --git a/client.h b/client.h index fd40416641..239629391f 100644 --- a/client.h +++ b/client.h @@ -90,8 +90,12 @@ class Client * The desktop this Client is on. If the Client is on all desktops the property has value -1. **/ Q_PROPERTY(int desktop READ desktop WRITE setDesktop NOTIFY desktopChanged) - // TODO: notify signal, proper setter with only one attribute - Q_PROPERTY(bool fullScreen READ isFullScreen) + /** + * 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) Q_PROPERTY(bool fullScreenable READ isFullScreenable) // TODO: notify signal Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry) @@ -221,7 +225,7 @@ public: void setMaximize(bool vertically, bool horizontally); QRect iconGeometry() const; - void setFullScreen(bool set, bool user); + void setFullScreen(bool set, bool user = true); bool isFullScreen() const; bool isFullScreenable(bool fullscreen_hack = false) const; bool isActiveFullScreen() const; @@ -533,6 +537,7 @@ signals: void activeChanged(); void captionChanged(); void desktopChanged(); + void fullScreenChanged(); private: void exportMappingState(int s); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1 diff --git a/geometry.cpp b/geometry.cpp index 0e134e03e8..24e953ecb9 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2428,6 +2428,9 @@ void Client::setFullScreen(bool set, bool user) #endif emit s_fullScreenSet(set, user); + if (was_fs != isFullScreen()) { + emit fullScreenChanged(); + } } @@ -2502,10 +2505,12 @@ void Client::updateFullScreenHack(const QRect& geom) } else geom = workspace()->clientArea(FullScreenArea, geom.center(), desktop()); setGeometry(geom); + emit fullScreenChanged(); } else if (fullscreen_mode == FullScreenHack && type == 0) { fullscreen_mode = FullScreenNone; updateDecoration(false, false); // whoever called this must setup correct geometry + emit fullScreenChanged(); } StackingUpdatesBlocker blocker(workspace()); workspace()->updateClientLayer(this); // active fullscreens get different layer