From 48c28a9b3db2ac55377cf9342cac3bc10ab3b9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Thu, 29 Dec 2011 23:33:45 +0100 Subject: [PATCH] add dbus debug "activeEffects" REVIEW: 103572 CCBUG: 288948 CCBUG: 290025 (cherry picked from commit 089aeee91b807d13c0c2b86fa18d05776bef5190) --- composite.cpp | 7 +++++++ effects.cpp | 12 ++++++++++++ effects.h | 1 + org.kde.KWin.xml | 3 +++ workspace.h | 1 + 5 files changed, 24 insertions(+) diff --git a/composite.cpp b/composite.cpp index 6e5c27363b..55a7144007 100644 --- a/composite.cpp +++ b/composite.cpp @@ -275,6 +275,13 @@ void Workspace::toggleCompositing() } } +QStringList Workspace::activeEffects() const +{ + if (effects) + return static_cast< EffectsHandlerImpl* >(effects)->activeEffects(); + return QStringList(); +} + void Workspace::updateCompositeBlocking(Client *c) { if (c) { // if c == 0 we just check if we can resume diff --git a/effects.cpp b/effects.cpp index e388b33e4a..6c252c9e65 100644 --- a/effects.cpp +++ b/effects.cpp @@ -1253,6 +1253,18 @@ void EffectsHandlerImpl::effectsChanged() } } +QStringList EffectsHandlerImpl::activeEffects() const +{ + QStringList ret; + for(QVector< KWin::EffectPair >::const_iterator it = loaded_effects.constBegin(), + end = loaded_effects.constEnd(); it != end; ++it) { + if (it->second->isActive()) { + ret << it->first; + } + } + return ret; +} + EffectFrame* EffectsHandlerImpl::effectFrame(EffectFrameStyle style, bool staticSize, const QPoint& position, Qt::Alignment alignment) const { return new EffectFrameImpl(style, staticSize, position, alignment); diff --git a/effects.h b/effects.h index 6530871e8e..f4ad2fbd85 100644 --- a/effects.h +++ b/effects.h @@ -170,6 +170,7 @@ public: QStringList listOfEffects() const; QList elevatedWindows() const; + QStringList activeEffects() const; public Q_SLOTS: void slotClientGroupItemSwitched(EffectWindow* from, EffectWindow* to); diff --git a/org.kde.KWin.xml b/org.kde.KWin.xml index bd993ed90f..f89b2c70f1 100644 --- a/org.kde.KWin.xml +++ b/org.kde.KWin.xml @@ -81,5 +81,8 @@ + + + diff --git a/workspace.h b/workspace.h index 9438f3ef03..092b6a72ff 100644 --- a/workspace.h +++ b/workspace.h @@ -459,6 +459,7 @@ public: void previousTileLayout(); bool stopActivity(const QString &id); bool startActivity(const QString &id); + QStringList activeEffects() const; void setCurrentScreen(int new_screen);