From 533e3e5adfbec6999d560ee772b6fadf99dd49a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 21 Nov 2012 15:13:57 +0100 Subject: [PATCH] Move circulateDesktopApplications into DBusInterface It is not used anywhere inside KWin at all and the DBus method is not used anywhere inside KDE's repositories (according to lxr). Because of that marked as deprecated and going to die with Qt 5. REVIEW: 107406 --- dbusinterface.cpp | 18 +++++++++++++++++- dbusinterface.h | 3 +++ layers.cpp | 14 -------------- workspace.h | 1 - 4 files changed, 20 insertions(+), 16 deletions(-) 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);