From: Dana Jansens Date: Sat, 20 Apr 2002 18:30:47 +0000 (+0000) Subject: changes to bestfit from ruhi. takes windows sizes into account properly, and places... X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=ca3bc6421b39584e8d111719db8c16adb8a7320c;p=chaz%2Fopenbox changes to bestfit from ruhi. takes windows sizes into account properly, and places windows 1 borderwidth apart on all sides, while still placeing up against the edge of the screen. --- diff --git a/src/Workspace.cc b/src/Workspace.cc index 06bd9d66..894d49a2 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -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;