[kwineffects] Expose fullScreen property in EffectWindow

Also copied to Deleted.
This commit is contained in:
Martin Gräßlin 2016-01-27 14:14:37 +01:00
parent 5f15528428
commit 1fb0c31bb4
4 changed files with 20 additions and 0 deletions

View file

@ -42,6 +42,7 @@ Deleted::Deleted()
, m_modal(false) , m_modal(false)
, m_wasClient(false) , m_wasClient(false)
, m_decorationRenderer(nullptr) , m_decorationRenderer(nullptr)
, m_fullscreen(false)
{ {
} }
@ -108,6 +109,7 @@ void Deleted::copyToDeleted(Toplevel* c)
foreach (AbstractClient *c, m_mainClients) { foreach (AbstractClient *c, m_mainClients) {
connect(c, &AbstractClient::windowClosed, this, &Deleted::mainClientClosed); connect(c, &AbstractClient::windowClosed, this, &Deleted::mainClientClosed);
} }
m_fullscreen = client->isFullScreen();
} }
} }

View file

@ -39,6 +39,7 @@ class KWIN_EXPORT Deleted
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool minimized READ isMinimized) Q_PROPERTY(bool minimized READ isMinimized)
Q_PROPERTY(bool modal READ isModal) Q_PROPERTY(bool modal READ isModal)
Q_PROPERTY(bool fullScreen READ isFullScreen CONSTANT)
public: public:
static Deleted* create(Toplevel* c); static Deleted* create(Toplevel* c);
// used by effects to keep the window around for e.g. fadeout effects when it's destroyed // 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 { const Decoration::Renderer *decorationRenderer() const {
return m_decorationRenderer; return m_decorationRenderer;
} }
bool isFullScreen() const {
return m_fullscreen;
}
protected: protected:
virtual void debug(QDebug& stream) const; virtual void debug(QDebug& stream) const;
virtual bool shouldUnredirect() const; virtual bool shouldUnredirect() const;
@ -114,6 +119,7 @@ private:
double m_opacity; double m_opacity;
NET::WindowType m_type = NET::Unknown; NET::WindowType m_type = NET::Unknown;
QByteArray m_windowRole; QByteArray m_windowRole;
bool m_fullscreen;
}; };
inline void Deleted::refWindow() inline void Deleted::refWindow()

View file

@ -839,6 +839,7 @@ WINDOW_HELPER_DEFAULT(QIcon, icon, "icon", QIcon())
WINDOW_HELPER_DEFAULT(bool, isSkipSwitcher, "skipSwitcher", false) WINDOW_HELPER_DEFAULT(bool, isSkipSwitcher, "skipSwitcher", false)
WINDOW_HELPER_DEFAULT(bool, isCurrentTab, "isCurrentTab", false) WINDOW_HELPER_DEFAULT(bool, isCurrentTab, "isCurrentTab", false)
WINDOW_HELPER_DEFAULT(bool, decorationHasAlpha, "decorationHasAlpha", false) WINDOW_HELPER_DEFAULT(bool, decorationHasAlpha, "decorationHasAlpha", false)
WINDOW_HELPER_DEFAULT(bool, isFullScreen, "fullScreen", false)
#undef WINDOW_HELPER_DEFAULT #undef WINDOW_HELPER_DEFAULT

View file

@ -1660,6 +1660,12 @@ class KWINEFFECTS_EXPORT EffectWindow : public QObject
* relevant only in Wayland, on X11 it will be nullptr * relevant only in Wayland, on X11 it will be nullptr
*/ */
Q_PROPERTY(KWayland::Server::SurfaceInterface *surface READ surface) Q_PROPERTY(KWayland::Server::SurfaceInterface *surface READ surface)
/**
* Whether the window is fullscreen.
* @since 5.6
**/
Q_PROPERTY(bool fullScreen READ isFullScreen)
public: public:
/** Flags explaining why painting should be disabled */ /** Flags explaining why painting should be disabled */
enum { enum {
@ -1897,6 +1903,11 @@ public:
*/ */
KWayland::Server::SurfaceInterface *surface() const; KWayland::Server::SurfaceInterface *surface() const;
/**
* @since 5.6
**/
bool isFullScreen() const;
/** /**
* Can be used to by effects to store arbitrary data in the EffectWindow. * Can be used to by effects to store arbitrary data in the EffectWindow.
*/ */