]> Dogcows Code - chaz/openbox/commitdiff
changes to bestfit from ruhi. takes windows sizes into account properly, and places...
authorDana Jansens <danakj@orodu.net>
Sat, 20 Apr 2002 18:30:47 +0000 (18:30 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 20 Apr 2002 18:30:47 +0000 (18:30 +0000)
src/Workspace.cc

index 06bd9d66c9a5ede34ee399dbb5a70341c9d40031..894d49a29f7a71c2154e9de88b1c0dd8cb0f8e6f 100644 (file)
@@ -332,11 +332,11 @@ void Workspace::shutdown(void) {
   }
 }
 
-static rectList calcSpace(const OpenboxWindow &win, const rectList &spaces) {
+static rectList calcSpace(const Rect &win, const rectList &spaces) {
   rectList result;
   rectList::const_iterator siter;
   for(siter=spaces.begin(); siter!=spaces.end(); ++siter) {
-    if(win.area().Intersect(*siter)) {
+    if(win.Intersect(*siter)) {
       //Check for space to the left of the window
       if(win.origin().x() > siter->x())
         result.push_back(Rect(siter->x(), siter->y(),
@@ -385,7 +385,8 @@ Point *Workspace::bestFitPlacement(const Size &win_size, const Rect &space)
   
   //Find Free Spaces
   for (OpenboxWindow *cur=it.current(); cur!=NULL; it++, cur=it.current())
-     spaces = calcSpace(*cur, spaces);
+     spaces = calcSpace(cur->area().Inflate(screen.getBorderWidth() * 4),
+                        spaces);
   
   //Find first space that fits the window
   best = NULL;
This page took 0.02293 seconds and 4 git commands to generate.