diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-04-20 18:30:47 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-04-20 18:30:47 +0000 |
| commit | ca3bc6421b39584e8d111719db8c16adb8a7320c (patch) | |
| tree | 6f06b8261f0074f3a251e609494de17b7a76685c /src/Workspace.cc | |
| parent | de7a567d5b1c878e77624e09862bff7466b8dd10 (diff) | |
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.
Diffstat (limited to 'src/Workspace.cc')
| -rw-r--r-- | src/Workspace.cc | 7 |
1 files changed, 4 insertions, 3 deletions
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; |
