diff --git a/dbusinterface.cpp b/dbusinterface.cpp index 180f6cf670..6d64a9fc6a 100644 --- a/dbusinterface.cpp +++ b/dbusinterface.cpp @@ -21,6 +21,8 @@ along with this program. If not, see . // own #include "dbusinterface.h" // kwin +// TODO: remove together with deprecated methods +#include "client.h" #include "composite.h" #include "effects.h" #include "kwinadaptor.h" @@ -48,6 +50,21 @@ DBusInterface::~DBusInterface() { } +void DBusInterface::circulateDesktopApplications() +{ + Workspace *ws = Workspace::self(); + const QList &desktops = ws->desktopList(); + if (desktops.count() > 1) { + bool change_active = ws->activeClient()->isDesktop(); + ws->raiseClient(ws->findDesktop(false, currentDesktop())); + if (change_active) // if the previously topmost Desktop was active, activate this new one + ws->activateClient(ws->findDesktop(true, currentDesktop())); + } + // if there's no active client, make desktop the active one + if (desktops.count() > 0 && ws->activeClient() == NULL && ws->mostRecentlyActivatedClient() == NULL) + ws->activateClient(ws->findDesktop(true, currentDesktop())); +} + // wrap void methods with no arguments to Workspace #define WRAP(name) \ void DBusInterface::name() \ @@ -56,7 +73,6 @@ void DBusInterface::name() \ } WRAP(cascadeDesktop) -WRAP(circulateDesktopApplications) WRAP(killWindow) WRAP(nextDesktop) WRAP(previousDesktop) diff --git a/dbusinterface.h b/dbusinterface.h index e49d4e0ab2..d8e8cd3500 100644 --- a/dbusinterface.h +++ b/dbusinterface.h @@ -59,6 +59,9 @@ public: public: // PROPERTIES public Q_SLOTS: // METHODS Q_NOREPLY void cascadeDesktop(); + /** + * @deprecated + **/ void circulateDesktopApplications(); int currentDesktop(); QList decorationSupportedColors(); diff --git a/layers.cpp b/layers.cpp index 706cb4bf41..5104e19d1d 100644 --- a/layers.cpp +++ b/layers.cpp @@ -510,20 +510,6 @@ void Workspace::restoreSessionStackingOrder(Client* c) unconstrained_stacking_order.append(c); } -void Workspace::circulateDesktopApplications() -{ - if (desktops.count() > 1) { - bool change_active = activeClient()->isDesktop(); - raiseClient(findDesktop(false, currentDesktop())); - if (change_active) // if the previously topmost Desktop was active, activate this new one - activateClient(findDesktop(true, currentDesktop())); - } - // if there's no active client, make desktop the active one - if (desktops.count() > 0 && activeClient() == NULL && should_get_focus.count() == 0) - activateClient(findDesktop(true, currentDesktop())); -} - - /*! Returns a stacking order based upon \a list that fulfills certain contained. */ diff --git a/workspace.h b/workspace.h index bd12845f24..708e23333d 100644 --- a/workspace.h +++ b/workspace.h @@ -458,7 +458,6 @@ public: QList decorationSupportedColors() const; void nextDesktop(); void previousDesktop(); - void circulateDesktopApplications(); bool waitForCompositingSetup(); bool stopActivity(const QString &id); bool startActivity(const QString &id);