ignore desktops and splashes for snapping
Desktops cannot be resonably snapped or cause implicit screen snapping and splashes are undemanded short term clients REVIEW: 111139
This commit is contained in:
parent
16ee964eb7
commit
774e3ec05b
1 changed files with 55 additions and 52 deletions
27
geometry.cpp
27
geometry.cpp
|
@ -456,19 +456,25 @@ QPoint Workspace::adjustClientPosition(Client* c, QPoint pos, bool unrestricted,
|
|||
if (snap) {
|
||||
QList<Client *>::ConstIterator l;
|
||||
for (l = clients.constBegin(); l != clients.constEnd(); ++l) {
|
||||
if ((((*l)->isOnDesktop(c->desktop()) && !(*l)->isMinimized())
|
||||
|| (c->isOnDesktop(NET::OnAllDesktops) && (*l)->isOnDesktop(VirtualDesktopManager::self()->current())
|
||||
&& !(*l)->isMinimized()))
|
||||
&& (!(*l)->tabGroup() || (*l) == (*l)->tabGroup()->current())
|
||||
&& (*l) != c) {
|
||||
if ((*l) == c)
|
||||
continue;
|
||||
if ((*l)->isMinimized())
|
||||
continue; // is minimized
|
||||
if ((*l)->tabGroup() && (*l) != (*l)->tabGroup()->current())
|
||||
continue; // is not active tab
|
||||
if (!((*l)->isOnDesktop(c->desktop()) || c->isOnDesktop((*l)->desktop())))
|
||||
continue; // wrong virtual desktop
|
||||
if (!(*l)->isOnCurrentActivity())
|
||||
continue; // wrong activity
|
||||
if ((*l)->isDesktop() || (*l)->isSplash())
|
||||
continue;
|
||||
|
||||
lx = (*l)->x();
|
||||
ly = (*l)->y();
|
||||
lrx = lx + (*l)->width();
|
||||
lry = ly + (*l)->height();
|
||||
|
||||
if (((cy <= lry) && (cy >= ly)) ||
|
||||
((ry >= ly) && (ry <= lry)) ||
|
||||
((cy <= ly) && (ry >= lry))) {
|
||||
if (((cy <= lry) && (cy >= ly)) || ((ry >= ly) && (ry <= lry)) || ((cy <= ly) && (ry >= lry))) {
|
||||
if ((sOWO ? (cx < lrx) : true) && (qAbs(lrx - cx) < snap) && (qAbs(lrx - cx) < deltaX)) {
|
||||
deltaX = qAbs(lrx - cx);
|
||||
nx = lrx;
|
||||
|
@ -479,9 +485,7 @@ QPoint Workspace::adjustClientPosition(Client* c, QPoint pos, bool unrestricted,
|
|||
}
|
||||
}
|
||||
|
||||
if (((cx <= lrx) && (cx >= lx)) ||
|
||||
((rx >= lx) && (rx <= lrx)) ||
|
||||
((cx <= lx) && (rx >= lrx))) {
|
||||
if (((cx <= lrx) && (cx >= lx)) || ((rx >= lx) && (rx <= lrx)) || ((cx <= lx) && (rx >= lrx))) {
|
||||
if ((sOWO ? (cy < lry) : true) && (qAbs(lry - cy) < snap) && (qAbs(lry - cy) < deltaY)) {
|
||||
deltaY = qAbs(lry - cy);
|
||||
ny = lry;
|
||||
|
@ -516,7 +520,6 @@ QPoint Workspace::adjustClientPosition(Client* c, QPoint pos, bool unrestricted,
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// center snap
|
||||
snap = options->centerSnapZone() * snapAdjust; //snap trigger
|
||||
|
|
Loading…
Reference in a new issue