From 3af37460f881c1e742ed253cf17c85c206807c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 2 Feb 2012 10:48:12 +0100 Subject: [PATCH] Make minimize EffectWindows work through scripting --- libkwineffects/kwineffects.cpp | 9 +++++++++ libkwineffects/kwineffects.h | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libkwineffects/kwineffects.cpp b/libkwineffects/kwineffects.cpp index 910e807dd3..135c9ae165 100644 --- a/libkwineffects/kwineffects.cpp +++ b/libkwineffects/kwineffects.cpp @@ -399,6 +399,15 @@ WINDOW_HELPER_SETTER(unminimize, "minimized",,false) #undef WINDOW_HELPER_SETTER +void EffectWindow::setMinimized(bool min) +{ + if (min) { + minimize(); + } else { + unminimize(); + } +} + void EffectWindow::closeWindow() const { QMetaObject::invokeMethod(parent(), "closeWindow"); diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index a768fb7fa4..05408afe59 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -1184,7 +1184,7 @@ class KWIN_EXPORT EffectWindow : public QObject /** * Whether the window is minimized. **/ - Q_PROPERTY(bool minimized READ isMinimized) + Q_PROPERTY(bool minimized READ isMinimized WRITE setMinimized) /** * Whether the window represents a modal window. **/ @@ -1444,6 +1444,7 @@ public: */ virtual WindowQuadList buildQuads(bool force = false) const = 0; + void setMinimized(bool minimize); void minimize(); void unminimize(); Q_SCRIPTABLE void closeWindow() const;