From ca3bc6421b39584e8d111719db8c16adb8a7320c Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 20 Apr 2002 18:30:47 +0000 Subject: [PATCH] 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. --- src/Workspace.cc | 7 ++++--- 1 file 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; -- 2.39.2