From 1fb0c31bb467e86e6d58e18a7b96460197de6f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 27 Jan 2016 14:14:37 +0100 Subject: [PATCH] [kwineffects] Expose fullScreen property in EffectWindow Also copied to Deleted. --- deleted.cpp | 2 ++ deleted.h | 6 ++++++ libkwineffects/kwineffects.cpp | 1 + libkwineffects/kwineffects.h | 11 +++++++++++ 4 files changed, 20 insertions(+) diff --git a/deleted.cpp b/deleted.cpp index 239ba8fec7..baea30e830 100644 --- a/deleted.cpp +++ b/deleted.cpp @@ -42,6 +42,7 @@ Deleted::Deleted() , m_modal(false) , m_wasClient(false) , m_decorationRenderer(nullptr) + , m_fullscreen(false) { } @@ -108,6 +109,7 @@ void Deleted::copyToDeleted(Toplevel* c) foreach (AbstractClient *c, m_mainClients) { connect(c, &AbstractClient::windowClosed, this, &Deleted::mainClientClosed); } + m_fullscreen = client->isFullScreen(); } } diff --git a/deleted.h b/deleted.h index bb87ae9611..b89c961ef1 100644 --- a/deleted.h +++ b/deleted.h @@ -39,6 +39,7 @@ class KWIN_EXPORT Deleted Q_OBJECT Q_PROPERTY(bool minimized READ isMinimized) Q_PROPERTY(bool modal READ isModal) + Q_PROPERTY(bool fullScreen READ isFullScreen CONSTANT) public: static Deleted* create(Toplevel* c); // used by effects to keep the window around for e.g. fadeout effects when it's destroyed @@ -82,6 +83,10 @@ public: const Decoration::Renderer *decorationRenderer() const { return m_decorationRenderer; } + + bool isFullScreen() const { + return m_fullscreen; + } protected: virtual void debug(QDebug& stream) const; virtual bool shouldUnredirect() const; @@ -114,6 +119,7 @@ private: double m_opacity; NET::WindowType m_type = NET::Unknown; QByteArray m_windowRole; + bool m_fullscreen; }; inline void Deleted::refWindow() diff --git a/libkwineffects/kwineffects.cpp b/libkwineffects/kwineffects.cpp index b767f66712..b5f4665b4d 100644 --- a/libkwineffects/kwineffects.cpp +++ b/libkwineffects/kwineffects.cpp @@ -839,6 +839,7 @@ WINDOW_HELPER_DEFAULT(QIcon, icon, "icon", QIcon()) WINDOW_HELPER_DEFAULT(bool, isSkipSwitcher, "skipSwitcher", false) WINDOW_HELPER_DEFAULT(bool, isCurrentTab, "isCurrentTab", false) WINDOW_HELPER_DEFAULT(bool, decorationHasAlpha, "decorationHasAlpha", false) +WINDOW_HELPER_DEFAULT(bool, isFullScreen, "fullScreen", false) #undef WINDOW_HELPER_DEFAULT diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index 4350e2b1c8..d3e361256f 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -1660,6 +1660,12 @@ class KWINEFFECTS_EXPORT EffectWindow : public QObject * relevant only in Wayland, on X11 it will be nullptr */ Q_PROPERTY(KWayland::Server::SurfaceInterface *surface READ surface) + + /** + * Whether the window is fullscreen. + * @since 5.6 + **/ + Q_PROPERTY(bool fullScreen READ isFullScreen) public: /** Flags explaining why painting should be disabled */ enum { @@ -1897,6 +1903,11 @@ public: */ KWayland::Server::SurfaceInterface *surface() const; + /** + * @since 5.6 + **/ + bool isFullScreen() const; + /** * Can be used to by effects to store arbitrary data in the EffectWindow. */