From 47d2b4cb49aaf98378c3ad780464c93edc3e5c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 18 Sep 2015 13:46:42 +0200 Subject: [PATCH] Workspace::adjustClientPosition operates on AbstractClient With that moving clients snap also against ShellClients and not just Clients. --- geometry.cpp | 5 ++--- workspace.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index e689e14e4d..ecef03d5da 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -400,7 +400,7 @@ int Workspace::oldDisplayHeight() const effective snap zones. When 1.0, it means that the snap zones will be used without change. */ -QPoint Workspace::adjustClientPosition(Client* c, QPoint pos, bool unrestricted, double snapAdjust) +QPoint Workspace::adjustClientPosition(AbstractClient* c, QPoint pos, bool unrestricted, double snapAdjust) { QSize borderSnapZone(options->borderSnapZone(), options->borderSnapZone()); QRect maxRect; @@ -487,8 +487,7 @@ QPoint Workspace::adjustClientPosition(Client* c, QPoint pos, bool unrestricted, // windows snap int snap = options->windowSnapZone() * snapAdjust; if (snap) { - QList::ConstIterator l; - for (l = clients.constBegin(); l != clients.constEnd(); ++l) { + for (auto l = m_allClients.constBegin(); l != m_allClients.constEnd(); ++l) { if ((*l) == c) continue; if ((*l)->isMinimized()) diff --git a/workspace.h b/workspace.h index b055fb8b17..6b8b28ea53 100644 --- a/workspace.h +++ b/workspace.h @@ -172,7 +172,7 @@ public: */ void setClientIsMoving(AbstractClient* c); - QPoint adjustClientPosition(Client* c, QPoint pos, bool unrestricted, double snapAdjust = 1.0); + QPoint adjustClientPosition(AbstractClient* c, QPoint pos, bool unrestricted, double snapAdjust = 1.0); QRect adjustClientSize(Client* c, QRect moveResizeGeom, int mode); void raiseClient(AbstractClient* c, bool nogroup = false); void lowerClient(AbstractClient* c, bool nogroup = false);