]> Dogcows Code - chaz/openbox/commitdiff
use the snap offset as the margin for placing windows instead of a fixed value of 1
authorDana Jansens <danakj@orodu.net>
Fri, 23 Aug 2002 23:13:21 +0000 (23:13 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 23 Aug 2002 23:13:21 +0000 (23:13 +0000)
src/Workspace.cc
src/Workspace.hh

index 715d012e6b50c48da83749895205e9673ac931ab..f4fab1cdf6b58b290208dbb5f189808c0785f29c 100644 (file)
@@ -530,9 +530,8 @@ void Workspace::setName(const string& new_name) {
 /*
  * Calculate free space available for window placement.
  */
-typedef std::vector<Rect> rectList;
-
-static rectList calcSpace(const Rect &win, const rectList &spaces) {
+Workspace::rectList Workspace::calcSpace(const Rect &win,
+                                         const rectList &spaces) const {
   Rect isect, extra;
   rectList result;
   rectList::const_iterator siter, end = spaces.end();
@@ -553,21 +552,21 @@ static rectList calcSpace(const Rect &win, const rectList &spaces) {
 
     // left
     extra.setCoords(curr.left(), curr.top(),
-                    isect.left() - 1, curr.bottom());
+                    isect.left() - screen->getSnapOffset(), curr.bottom());
     if (extra.valid()) result.push_back(extra);
 
     // top
     extra.setCoords(curr.left(), curr.top(),
-                    curr.right(), isect.top() - 1);
+                    curr.right(), isect.top() - screen->getSnapOffset());
     if (extra.valid()) result.push_back(extra);
 
     // right
-    extra.setCoords(isect.right() + 1, curr.top(),
+    extra.setCoords(isect.right() + screen->getSnapOffset(), curr.top(),
                     curr.right(), curr.bottom());
     if (extra.valid()) result.push_back(extra);
 
     // bottom
-    extra.setCoords(curr.left(), isect.bottom() + 1,
+    extra.setCoords(curr.left(), isect.bottom() + screen->getSnapOffset(),
                     curr.right(), curr.bottom());
     if (extra.valid()) result.push_back(extra);
   }
index 72203f2dbbd37329bd979a8c33828a54e6bbed24..df0411e130645cc221360cbf06e0359748f6d656 100644 (file)
@@ -65,6 +65,9 @@ private:
   void lowerTransients(const BlackboxWindow * const win,
                        StackVector::iterator &stack);
 
+  typedef std::vector<Rect> rectList;
+  rectList calcSpace(const Rect &win, const rectList &spaces) const;
+
   void placeWindow(BlackboxWindow *win);
   bool cascadePlacement(Rect& win, const int offset);
   bool smartPlacement(Rect& win);
This page took 0.023563 seconds and 4 git commands to generate.