Commit 9d4a3259 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Drop some custom list typedefs

Summary:
Qt has its own thing where a type might also have corresponding list
alias, e.g. QObject and QObjectList, QWidget and QWidgetList. I don't
know why Qt does that, maybe for some historical reasons, but what
matters is that we copy this pattern here in KWin. While this pattern
might be useful with some long list types, for example

    QList<QWeakPointer<TabBoxClient>> TabBoxClientList

in general, it causes more harm than good. For example, we've got two
new client types, do we need corresponding list typedefs for them? If
no, why do we have ClientList and so on?

Another problem with these typedefs is that you need to include utils.h
header in order to use them. A better way to handle such things is to
just forward declare a client class (if that's possible) and use it
directly with QList or QVector. This way translation units don't get
"bloated" with utils.h stuff for no apparent reason.

So, in order to make code more consistent and easier to follow, this
change drops some of our custom typedefs. Namely ConstClientList,
ClientList, DeletedList, UnmanagedList, ToplevelList, and GroupList.

Test Plan: Compiles.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24950
parent 84d75cb5
......@@ -1035,7 +1035,7 @@ bool AbstractClient::performMouseCommand(Options::MouseCommand cmd, const QPoint
replay = isActive(); // for clickraise mode
bool mustReplay = !rules()->checkAcceptFocus(acceptsFocus());
if (mustReplay) {
ToplevelList::const_iterator it = workspace()->stackingOrder().constEnd(),
auto it = workspace()->stackingOrder().constEnd(),
begin = workspace()->stackingOrder().constBegin();
while (mustReplay && --it != begin && *it != this) {
AbstractClient *c = qobject_cast<AbstractClient*>(*it);
......
......@@ -417,7 +417,7 @@ void Workspace::clientHidden(AbstractClient* c)
AbstractClient *Workspace::clientUnderMouse(int screen) const
{
ToplevelList::const_iterator it = stackingOrder().constEnd();
auto it = stackingOrder().constEnd();
while (it != stackingOrder().constBegin()) {
AbstractClient *client = qobject_cast<AbstractClient*>(*(--it));
if (!client) {
......@@ -751,8 +751,8 @@ xcb_timestamp_t X11Client::readUserTimeMapTimestamp(const KStartupInfoId *asn_id
&& cl != this && X11Client::belongToSameApplication(cl, this, SameApplicationCheck::RelaxedForActive);
};
if (isTransient()) {
auto clientMainClients = [this] () -> ClientList {
ClientList ret;
auto clientMainClients = [this]() {
QList<X11Client *> ret;
const auto mcs = mainClients();
for (auto mc: mcs) {
if (X11Client *c = dynamic_cast<X11Client *>(mc)) {
......
......@@ -164,8 +164,8 @@ void Activities::reallyStop(const QString &id)
QSet<QByteArray> saveSessionIds;
QSet<QByteArray> dontCloseSessionIds;
const ClientList &clients = ws->clientList();
for (ClientList::const_iterator it = clients.constBegin(); it != clients.constEnd(); ++it) {
const QList<X11Client *> &clients = ws->clientList();
for (auto it = clients.constBegin(); it != clients.constEnd(); ++it) {
const X11Client *c = (*it);
const QByteArray sessionId = c->sessionId();
if (sessionId.isEmpty()) {
......
......@@ -402,7 +402,7 @@ void ActivationTest::testSwitchToWindowMaximized()
Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red);
QVERIFY(geometryChangedSpy2.wait());
const ToplevelList stackingOrder = workspace()->stackingOrder();
const QList<Toplevel *> stackingOrder = workspace()->stackingOrder();
QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2));
QCOMPARE(client1->maximizeMode(), MaximizeFull);
QCOMPARE(client2->maximizeMode(), MaximizeFull);
......@@ -487,7 +487,7 @@ void ActivationTest::testSwitchToWindowFullScreen()
Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red);
QVERIFY(geometryChangedSpy2.wait());
const ToplevelList stackingOrder = workspace()->stackingOrder();
const QList<Toplevel *> stackingOrder = workspace()->stackingOrder();
QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2));
QVERIFY(client1->isFullScreen());
QVERIFY(client2->isFullScreen());
......
......@@ -108,7 +108,7 @@ void StackingOrderTest::testTransientIsAboveParent()
QVERIFY(!parent->isTransient());
// Initially, the stacking order should contain only the parent window.
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{parent}));
// Create the transient.
KWayland::Client::Surface *transientSurface =
......@@ -125,13 +125,13 @@ void StackingOrderTest::testTransientIsAboveParent()
QVERIFY(transient->isTransient());
// The transient should be above the parent.
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{parent, transient}));
// The transient still stays above the parent if we activate the latter.
workspace()->activateClient(parent);
QTRY_VERIFY(parent->isActive());
QTRY_VERIFY(!transient->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{parent, transient}));
}
void StackingOrderTest::testRaiseTransient()
......@@ -152,7 +152,7 @@ void StackingOrderTest::testRaiseTransient()
QVERIFY(!parent->isTransient());
// Initially, the stacking order should contain only the parent window.
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{parent}));
// Create the transient.
KWayland::Client::Surface *transientSurface =
......@@ -169,7 +169,7 @@ void StackingOrderTest::testRaiseTransient()
QVERIFY(transient->isTransient());
// The transient should be above the parent.
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{parent, transient}));
// Create a window that doesn't have any relationship to the parent or the transient.
KWayland::Client::Surface *anotherSurface =
......@@ -184,28 +184,28 @@ void StackingOrderTest::testRaiseTransient()
QVERIFY(!anotherClient->isTransient());
// The newly created surface has to be above both the parent and the transient.
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient, anotherClient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{parent, transient, anotherClient}));
// If we activate the parent, the transient should be raised too.
workspace()->activateClient(parent);
QTRY_VERIFY(parent->isActive());
QTRY_VERIFY(!transient->isActive());
QTRY_VERIFY(!anotherClient->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{anotherClient, parent, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{anotherClient, parent, transient}));
// Go back to the initial setup.
workspace()->activateClient(anotherClient);
QTRY_VERIFY(!parent->isActive());
QTRY_VERIFY(!transient->isActive());
QTRY_VERIFY(anotherClient->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient, anotherClient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{parent, transient, anotherClient}));
// If we activate the transient, the parent should be raised too.
workspace()->activateClient(transient);
QTRY_VERIFY(!parent->isActive());
QTRY_VERIFY(transient->isActive());
QTRY_VERIFY(!anotherClient->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{anotherClient, parent, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{anotherClient, parent, transient}));
}
struct WindowUnrefDeleter
......@@ -234,7 +234,7 @@ void StackingOrderTest::testDeletedTransient()
QVERIFY(parent->isActive());
QVERIFY(!parent->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{parent}));
// Create the first transient.
KWayland::Client::Surface *transient1Surface =
......@@ -251,7 +251,7 @@ void StackingOrderTest::testDeletedTransient()
QVERIFY(transient1->isTransient());
QCOMPARE(transient1->transientFor(), parent);
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient1}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{parent, transient1}));
// Create the second transient.
KWayland::Client::Surface *transient2Surface =
......@@ -268,7 +268,7 @@ void StackingOrderTest::testDeletedTransient()
QVERIFY(transient2->isTransient());
QCOMPARE(transient2->transientFor(), transient1);
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient1, transient2}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{parent, transient1, transient2}));
// Activate the parent, both transients have to be above it.
workspace()->activateClient(parent);
......@@ -297,7 +297,7 @@ void StackingOrderTest::testDeletedTransient()
// The deleted transient still has to be above its old parent (transient1).
QTRY_VERIFY(parent->isActive());
QTRY_VERIFY(!transient1->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient1, deletedTransient.data()}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{parent, transient1, deletedTransient.data()}));
}
static xcb_window_t createGroupWindow(xcb_connection_t *conn,
......@@ -376,7 +376,7 @@ void StackingOrderTest::testGroupTransientIsAboveWindowGroup()
QCOMPARE(leader->windowId(), leaderWid);
QVERIFY(!leader->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader}));
// Create another group member.
windowCreatedSpy.clear();
......@@ -392,7 +392,7 @@ void StackingOrderTest::testGroupTransientIsAboveWindowGroup()
QCOMPARE(member1->group(), leader->group());
QVERIFY(!member1->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1}));
// Create yet another group member.
windowCreatedSpy.clear();
......@@ -408,7 +408,7 @@ void StackingOrderTest::testGroupTransientIsAboveWindowGroup()
QCOMPARE(member2->group(), leader->group());
QVERIFY(!member2->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2}));
// Create a group transient.
windowCreatedSpy.clear();
......@@ -448,24 +448,24 @@ void StackingOrderTest::testGroupTransientIsAboveWindowGroup()
QVERIFY(transient->groupTransient());
QVERIFY(!transient->isDialog()); // See above why
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2, transient}));
// If we activate any member of the window group, the transient will be above it.
workspace()->activateClient(leader);
QTRY_VERIFY(leader->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{member1, member2, leader, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{member1, member2, leader, transient}));
workspace()->activateClient(member1);
QTRY_VERIFY(member1->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{member2, leader, member1, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{member2, leader, member1, transient}));
workspace()->activateClient(member2);
QTRY_VERIFY(member2->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2, transient}));
workspace()->activateClient(transient);
QTRY_VERIFY(transient->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2, transient}));
}
void StackingOrderTest::testRaiseGroupTransient()
......@@ -490,7 +490,7 @@ void StackingOrderTest::testRaiseGroupTransient()
QCOMPARE(leader->windowId(), leaderWid);
QVERIFY(!leader->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader}));
// Create another group member.
windowCreatedSpy.clear();
......@@ -506,7 +506,7 @@ void StackingOrderTest::testRaiseGroupTransient()
QCOMPARE(member1->group(), leader->group());
QVERIFY(!member1->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1}));
// Create yet another group member.
windowCreatedSpy.clear();
......@@ -522,7 +522,7 @@ void StackingOrderTest::testRaiseGroupTransient()
QCOMPARE(member2->group(), leader->group());
QVERIFY(!member2->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2}));
// Create a group transient.
windowCreatedSpy.clear();
......@@ -562,7 +562,7 @@ void StackingOrderTest::testRaiseGroupTransient()
QVERIFY(transient->groupTransient());
QVERIFY(!transient->isDialog()); // See above why
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2, transient}));
// Create a Wayland client that is not a member of the window group.
KWayland::Client::Surface *anotherSurface =
......@@ -576,27 +576,27 @@ void StackingOrderTest::testRaiseGroupTransient()
QVERIFY(anotherClient->isActive());
QVERIFY(!anotherClient->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, transient, anotherClient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2, transient, anotherClient}));
// If we activate the leader, then only it and the transient have to be raised.
workspace()->activateClient(leader);
QTRY_VERIFY(leader->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{member1, member2, anotherClient, leader, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{member1, member2, anotherClient, leader, transient}));
// If another member of the window group is activated, then the transient will
// be above that member and the leader.
workspace()->activateClient(member2);
QTRY_VERIFY(member2->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{member1, anotherClient, leader, member2, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{member1, anotherClient, leader, member2, transient}));
// FIXME: If we activate the transient, only it will be raised.
workspace()->activateClient(anotherClient);
QTRY_VERIFY(anotherClient->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{member1, leader, member2, transient, anotherClient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{member1, leader, member2, transient, anotherClient}));
workspace()->activateClient(transient);
QTRY_VERIFY(transient->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{member1, leader, member2, anotherClient, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{member1, leader, member2, anotherClient, transient}));
}
void StackingOrderTest::testDeletedGroupTransient()
......@@ -624,7 +624,7 @@ void StackingOrderTest::testDeletedGroupTransient()
QCOMPARE(leader->windowId(), leaderWid);
QVERIFY(!leader->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader}));
// Create another group member.
windowCreatedSpy.clear();
......@@ -640,7 +640,7 @@ void StackingOrderTest::testDeletedGroupTransient()
QCOMPARE(member1->group(), leader->group());
QVERIFY(!member1->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1}));
// Create yet another group member.
windowCreatedSpy.clear();
......@@ -656,7 +656,7 @@ void StackingOrderTest::testDeletedGroupTransient()
QCOMPARE(member2->group(), leader->group());
QVERIFY(!member2->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2}));
// Create a group transient.
windowCreatedSpy.clear();
......@@ -696,7 +696,7 @@ void StackingOrderTest::testDeletedGroupTransient()
QVERIFY(transient->groupTransient());
QVERIFY(!transient->isDialog()); // See above why
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2, transient}));
// Unmap the transient.
connect(transient, &X11Client::windowClosed, this,
......@@ -717,7 +717,7 @@ void StackingOrderTest::testDeletedGroupTransient()
QVERIFY(deletedTransient.data());
// The transient has to be above each member of the window group.
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, deletedTransient.data()}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2, deletedTransient.data()}));
}
void StackingOrderTest::testDontKeepAboveNonModalDialogGroupTransients()
......@@ -744,7 +744,7 @@ void StackingOrderTest::testDontKeepAboveNonModalDialogGroupTransients()
QCOMPARE(leader->windowId(), leaderWid);
QVERIFY(!leader->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader}));
// Create another group member.
windowCreatedSpy.clear();
......@@ -760,7 +760,7 @@ void StackingOrderTest::testDontKeepAboveNonModalDialogGroupTransients()
QCOMPARE(member1->group(), leader->group());
QVERIFY(!member1->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1}));
// Create yet another group member.
windowCreatedSpy.clear();
......@@ -776,7 +776,7 @@ void StackingOrderTest::testDontKeepAboveNonModalDialogGroupTransients()
QCOMPARE(member2->group(), leader->group());
QVERIFY(!member2->isTransient());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2}));
// Create a group transient.
windowCreatedSpy.clear();
......@@ -796,23 +796,23 @@ void StackingOrderTest::testDontKeepAboveNonModalDialogGroupTransients()
QVERIFY(transient->isDialog());
QVERIFY(!transient->isModal());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2, transient}));
workspace()->activateClient(leader);
QTRY_VERIFY(leader->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{member1, member2, transient, leader}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{member1, member2, transient, leader}));
workspace()->activateClient(member1);
QTRY_VERIFY(member1->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{member2, transient, leader, member1}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{member2, transient, leader, member1}));
workspace()->activateClient(member2);
QTRY_VERIFY(member2->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{transient, leader, member1, member2}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{transient, leader, member1, member2}));
workspace()->activateClient(transient);
QTRY_VERIFY(transient->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, transient}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{leader, member1, member2, transient}));
}
void StackingOrderTest::testKeepAbove()
......@@ -831,7 +831,7 @@ void StackingOrderTest::testKeepAbove()
QVERIFY(clientA->isActive());
QVERIFY(!clientA->keepAbove());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{clientA}));
// Create the second client.
KWayland::Client::Surface *clientBSurface =
......@@ -845,12 +845,12 @@ void StackingOrderTest::testKeepAbove()
QVERIFY(clientB->isActive());
QVERIFY(!clientB->keepAbove());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA, clientB}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{clientA, clientB}));
// Go to the initial test position.
workspace()->activateClient(clientA);
QTRY_VERIFY(clientA->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientB, clientA}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{clientB, clientA}));
// Set the "keep-above" flag on the client B, it should go above other clients.
{
......@@ -860,7 +860,7 @@ void StackingOrderTest::testKeepAbove()
QVERIFY(clientB->keepAbove());
QVERIFY(!clientB->isActive());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA, clientB}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{clientA, clientB}));
}
void StackingOrderTest::testKeepBelow()
......@@ -879,7 +879,7 @@ void StackingOrderTest::testKeepBelow()
QVERIFY(clientA->isActive());
QVERIFY(!clientA->keepBelow());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{clientA}));
// Create the second client.
KWayland::Client::Surface *clientBSurface =
......@@ -893,7 +893,7 @@ void StackingOrderTest::testKeepBelow()
QVERIFY(clientB->isActive());
QVERIFY(!clientB->keepBelow());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA, clientB}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{clientA, clientB}));
// Set the "keep-below" flag on the client B, it should go below other clients.
{
......@@ -903,7 +903,7 @@ void StackingOrderTest::testKeepBelow()
QVERIFY(clientB->isActive());
QVERIFY(clientB->keepBelow());
QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientB, clientA}));
QCOMPARE(workspace()->stackingOrder(), (QList<Toplevel *>{clientB, clientA}));
}
WAYLANDTEST_MAIN(StackingOrderTest)
......
......@@ -614,8 +614,8 @@ void Compositor::performCompositing()
}
// Create a list of all windows in the stacking order
ToplevelList windows = Workspace::self()->xStackingOrder();
ToplevelList damaged;
QList<Toplevel *> windows = Workspace::self()->xStackingOrder();
QList<Toplevel *> damaged;
// Reset the damage state of each window and fetch the damage region
// without waiting for a reply
......@@ -968,7 +968,7 @@ void X11Compositor::updateClientCompositeBlocking(X11Client *c)
// If !c we just check if we can resume in case a blocking client was lost.
bool shouldResume = true;
for (ClientList::ConstIterator it = Workspace::self()->clientList().constBegin();
for (auto it = Workspace::self()->clientList().constBegin();
it != Workspace::self()->clientList().constEnd(); ++it) {
if ((*it)->isBlockingCompositing()) {
shouldResume = false;
......
......@@ -162,7 +162,7 @@ public:
*
* Because the window is Deleted, it can have only Deleted child transients.
*/
DeletedList transients() const {
QList<Deleted *> transients() const {
return m_transients;
}
......@@ -236,8 +236,8 @@ private:
bool m_wasX11Client;
bool m_wasWaylandClient;
bool m_wasGroupTransient;
ToplevelList m_transientFor;
DeletedList m_transients;
QList<Toplevel *> m_transientFor;
QList<Deleted *> m_transients;
bool m_wasPopupWindow;
bool m_wasOutline;
qreal m_bufferScale = 1;
......
......@@ -1118,7 +1118,7 @@ EffectWindow *EffectsHandlerImpl::findWindow(const QUuid &id) const
EffectWindowList EffectsHandlerImpl::stackingOrder() const
{
ToplevelList list = Workspace::self()->xStackingOrder();
QList<Toplevel *> list = Workspace::self()->xStackingOrder();
EffectWindowList ret;
for (Toplevel *t : list) {
if (EffectWindow *w = effectWindow(t))
......
......@@ -138,7 +138,7 @@ void Workspace::updateClientArea(bool force)
iS ++)
new_sareas[ i ][ iS ] = screens[ iS ];
}
for (ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it) {
for (auto it = clients.constBegin(); it != clients.constEnd(); ++it) {
if (!(*it)->hasStrut())
continue;
QRect r = (*it)->adjustedClientArea(desktopArea, desktopArea);
......
......@@ -154,7 +154,7 @@ void Group::lostLeader()
Group* Workspace::findGroup(xcb_window_t leader) const
{
Q_ASSERT(leader != XCB_WINDOW_NONE);
for (GroupList::ConstIterator it = groups.constBegin();
for (auto it = groups.constBegin();
it != groups.constEnd();
++it)
if ((*it)->leader() == leader)
......@@ -167,7 +167,7 @@ Group* Workspace::findGroup(xcb_window_t leader) const
Group* Workspace::findClientLeaderGroup(const X11Client *c) const
{
Group* ret = nullptr;
for (ClientList::ConstIterator it = clients.constBegin();
for (auto it = clients.constBegin();
it != clients.constEnd();
++it) {
if (*it == c)
......@@ -180,7 +180,7 @@ Group* Workspace::findClientLeaderGroup(const X11Client *c) const
// This most probably means the app uses group transients without
// setting group for its windows. Merging the two groups is a bad
// hack, but there's no really good solution for this case.
ClientList old_group = (*it)->group()->members();
QList<X11Client *> old_group = (*it)->group()->members();
// old_group autodeletes when being empty
for (int pos = 0;
pos < old_group.count();
......@@ -248,7 +248,7 @@ void Workspace::updateOnAllDesktopsOfTransients(AbstractClient* c)
// A new window has been mapped. Check if it's not a mainwindow for some already existing transient window.
void Workspace::checkTransients(xcb_window_t w)
{
for (ClientList::ConstIterator it = clients.constBegin();
for (auto it = clients.constBegin();
it != clients.constEnd();
++it)
(*it)->checkTransient(w);
......@@ -452,7 +452,7 @@ void X11Client::removeFromMainClients()
if (transientFor())
transientFor()->removeTransient(this);
if (groupTransient()) {
for (ClientList::ConstIterator it = group()->members().constBegin();
for (auto it = group()->members().constBegin();
it != group()->members().constEnd();
++it)
(*it)->removeTransient(this);
......@@ -466,24 +466,24 @@ void X11Client::removeFromMainClients()
void X11Client::cleanGrouping()
{
// qDebug() << "CLEANGROUPING:" << this;
// for ( ClientList::ConstIterator it = group()->members().begin();
// for ( auto it = group()->members().begin();
// it != group()->members().end();
// ++it )
// qDebug() << "CL:" << *it;
// ClientList mains;
// QList<X11Client *> mains;
// mains = mainClients();
// for ( ClientList::ConstIterator it = mains.begin();
// for ( auto it = mains.begin();
// it != mains.end();
// ++it )
// qDebug() << "MN:" << *it;
removeFromMainClients();
// qDebug() << "CLEANGROUPING2:" << this;
// for ( ClientList::ConstIterator it = group()->members().begin();
// for ( auto it = group()->members().begin();
// it != group()->members().end();
// ++it )
// qDebug() << "CL2:" << *it;
// mains = mainClients();
// for ( ClientList::ConstIterator it = mains.begin();
// for ( auto it = mains.begin();
// it != mains.end();
// ++it )
// qDebug() << "MN2:" << *it;
......@@ -497,12 +497,12 @@ void X11Client::cleanGrouping()
++it;
}
// qDebug() << "CLEANGROUPING3:" << this;
// for ( ClientList::ConstIterator it = group()->members().begin();
// for ( auto it = group()->members().begin();
// it != group()->members().end();
// ++it )
// qDebug() << "CL3:" << *it;