From 5225cf192fbb4115bcc9bad23b267cab2f6bdb1e Mon Sep 17 00:00:00 2001 From: akir Date: Sun, 7 Nov 2004 09:30:59 +0000 Subject: fixed a problem with the snapping-windows code: decorationless windows have a borderWidth of 0 and thus the snapping was calculated wrong. --- src/Window.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Window.cc b/src/Window.cc index ccf0748..8265f91 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.305 2004/10/28 19:13:30 akir Exp $ +// $Id: Window.cc,v 1.306 2004/11/07 09:30:59 akir Exp $ #include "Window.hh" @@ -3047,12 +3047,15 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) { int dy = screen().getEdgeSnapThreshold() + 1; // we only care about the left/top etc that includes borders - int borderW = frame().window().borderWidth(); + int borderW = 0; + + if (decorationMask() & DECORM_ENABLED) + borderW = frame().window().borderWidth(); int top = orig_top; // orig include the borders int left = orig_left; - int right = orig_left + width() + 2*borderW; - int bottom = orig_top + height() + 2*borderW; + int right = orig_left + width() + 2 * borderW; + int bottom = orig_top + height() + 2 * borderW; ///////////////////////////////////// // begin by checking the screen (or Xinerama head) edges @@ -3083,14 +3086,16 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) { Workspace::Windows::iterator it = wins.begin(); Workspace::Windows::iterator it_end = wins.end(); + unsigned int bw; for (; it != it_end; it++) { if ((*it) == this) continue; // skip myself + bw = (*it)->decorationMask() & DECORM_ENABLED ? (*it)->frame().window().borderWidth() : 0; snapToWindow(dx, dy, left, right, top, bottom, (*it)->x(), - (*it)->x() + (*it)->width() + 2*borderW, + (*it)->x() + (*it)->width() + 2 * bw, (*it)->y(), - (*it)->y() + (*it)->height() + 2*borderW); + (*it)->y() + (*it)->height() + 2 * bw); } // commit -- cgit v0.11.2