Workspace::adjustClientPosition operates on AbstractClient

With that moving clients snap also against ShellClients and not just
Clients.
This commit is contained in:
Martin Gräßlin 2015-09-18 13:46:42 +02:00
parent 51888e8abd
commit 47d2b4cb49
2 changed files with 3 additions and 4 deletions

View file

@ -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<Client *>::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())

View file

@ -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);