fixed a problem with the snapping-windows code:

decorationless windows have a borderWidth of 0 and thus the
  snapping was calculated wrong.
This commit is contained in:
akir 2004-11-07 09:30:59 +00:00
parent 63f3429ea7
commit 5225cf192f

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // 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" #include "Window.hh"
@ -3047,7 +3047,10 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
int dy = screen().getEdgeSnapThreshold() + 1; int dy = screen().getEdgeSnapThreshold() + 1;
// we only care about the left/top etc that includes borders // 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 top = orig_top; // orig include the borders
int left = orig_left; int left = orig_left;
@ -3083,14 +3086,16 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
Workspace::Windows::iterator it = wins.begin(); Workspace::Windows::iterator it = wins.begin();
Workspace::Windows::iterator it_end = wins.end(); Workspace::Windows::iterator it_end = wins.end();
unsigned int bw;
for (; it != it_end; it++) { for (; it != it_end; it++) {
if ((*it) == this) continue; // skip myself if ((*it) == this) continue; // skip myself
bw = (*it)->decorationMask() & DECORM_ENABLED ? (*it)->frame().window().borderWidth() : 0;
snapToWindow(dx, dy, left, right, top, bottom, snapToWindow(dx, dy, left, right, top, bottom,
(*it)->x(), (*it)->x(),
(*it)->x() + (*it)->width() + 2*borderW, (*it)->x() + (*it)->width() + 2 * bw,
(*it)->y(), (*it)->y(),
(*it)->y() + (*it)->height() + 2*borderW); (*it)->y() + (*it)->height() + 2 * bw);
} }
// commit // commit