summaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-07-22 07:31:07 +0000
committerDana Jansens <danakj@orodu.net>2002-07-22 07:31:07 +0000
commitccecab79152aaf511714b49f8211262475a20a90 (patch)
treeb8aaeaed39a676ca7193e172be5c67263d15e46c /src/Window.cc
parentdebe8a2f74a67b8b484ae74b5d86769c3b2672eb (diff)
dont snap windows to rects they arent in for the screen regions (xinerama) or strut/screenarea
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Window.cc b/src/Window.cc
index a5fe7b4b..9de8b052 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -3039,11 +3039,11 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
// snap to the strut (and screen boundaries for xinerama)
#ifdef XINERAMA
- if (screen->isXineramaActive() && blackbox->doXineramaSnapping()) {
- RectList::iterator it, end = screen->allAvailableAreas().end();
- for (it = screen->allAvailableAreas().begin(); it != end; ++it)
- snaplist.push_back(*it);
- } else
+ if (screen->isXineramaActive() && blackbox->doXineramaSnapping())
+ snaplist.insert(snaplist.begin(),
+ screen->allAvailableAreas().begin(),
+ screen->allAvailableAreas().end());
+ else
#endif // XINERAMA
if (! screen->doFullMax())
snaplist.push_back(screen->availableArea());
@@ -3051,9 +3051,14 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
// always snap to the screen edges
snaplist.push_back(screen->getRect());
- RectList::iterator it, end = snaplist.end();
+ RectList::const_iterator it, end = snaplist.end();
for (it = snaplist.begin(); it != end; ++it) {
- Rect &srect = *it;
+ const Rect &srect = *it;
+
+ // if we're not in the rectangle then don't snap to it.
+ if (! srect.intersects(Rect(wleft, wtop, frame.rect.width(),
+ frame.rect.height())))
+ continue;
int dleft = std::abs(wleft - srect.left()),
dright = std::abs(wright - srect.right()),