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
icc-effect-5.14.5
Martin Gräßlin 2012-11-21 15:13:57 +01:00
parent 5a2504b19e
commit 533e3e5adf
4 changed files with 20 additions and 16 deletions

View File

@ -21,6 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// 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<Client*> &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)

View File

@ -59,6 +59,9 @@ public:
public: // PROPERTIES
public Q_SLOTS: // METHODS
Q_NOREPLY void cascadeDesktop();
/**
* @deprecated
**/
void circulateDesktopApplications();
int currentDesktop();
QList<int> decorationSupportedColors();

View File

@ -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.
*/

View File

@ -458,7 +458,6 @@ public:
QList<int> decorationSupportedColors() const;
void nextDesktop();
void previousDesktop();
void circulateDesktopApplications();
bool waitForCompositingSetup();
bool stopActivity(const QString &id);
bool startActivity(const QString &id);