From 92207be904aa92f057c0b65bdef408ce52d32a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Mon, 19 Jun 2017 17:56:15 +0200 Subject: [PATCH] Use AbstractClient instead of Client in placement Summary: There were a few places where we still used Client instead of AbstractClient. By changing this the placement also works for Wayland windows in those cases. Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D6274 --- placement.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/placement.cpp b/placement.cpp index 9dd646c597..9aada39c08 100644 --- a/placement.cpp +++ b/placement.cpp @@ -607,9 +607,7 @@ void Placement::placeMaximizing(AbstractClient* c, QRect& area, Policy nextPlace c->maximize(MaximizeFull); else { // if the geometry doesn't match default maximize area (xinerama case?), // it's probably better to use the given area - if (Client *client = qobject_cast(c)) { - client->setGeometry(area); - } + c->setGeometry(area); } } else { c->resizeWithChecks(c->maxSize().boundedTo(area.size())); @@ -626,7 +624,7 @@ void Placement::cascadeDesktop() // TODO: make area const once placeFoo methods are fixed to take a const QRect& QRect area = ws->clientArea(PlacementArea, QPoint(0, 0), desktop); foreach (Toplevel *toplevel, ws->stackingOrder()) { - Client *client = qobject_cast(toplevel); + auto client = qobject_cast(toplevel); if (!client || (!client->isOnCurrentDesktop()) || (client->isMinimized()) || @@ -639,9 +637,9 @@ void Placement::cascadeDesktop() void Placement::unclutterDesktop() { - const ClientList &clients = Workspace::self()->clientList(); + const auto &clients = Workspace::self()->allClientList(); for (int i = clients.size() - 1; i >= 0; i--) { - Client *client = clients.at(i); + auto client = clients.at(i); if ((!client->isOnCurrentDesktop()) || (client->isMinimized()) || (client->isOnAllDesktops()) ||