X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FWindow.cc;h=fa49ec216f296f0a06c9278eea252371d80f94f3;hb=4e84a99f0aaf74af1f9b4693486300370d41ff97;hp=98ac82fa6052148de8200297e4de4f41d6778d77;hpb=1ecf3b734ac6bda24a02f80cc9b9e6e4720f76af;p=chaz%2Fopenbox diff --git a/src/Window.cc b/src/Window.cc index 98ac82fa..fa49ec21 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -3124,7 +3124,7 @@ void BlackboxWindow::doWindowSnapping(int &dx, int &dy) { const int snap_to_windows = screen->getWindowToWindowSnap(); const int snap_to_edges = screen->getWindowToEdgeSnap(); // the amount of space away from the edge to provide resistance/snap - const int snap_offset = 0; + const int snap_offset = screen->getSnapOffset(); // find the geomeetery where the moving window currently is const Rect &moving = screen->doOpaqueMove() ? frame.rect : frame.changing; @@ -3193,12 +3193,14 @@ void BlackboxWindow::doWindowSnapping(int &dx, int &dy) { dright = offsetrect.right() - wleft; // snap left of other window? - if (dleft >= 0 && dleft < resistance_size) { + if (dleft >= 0 && dleft < resistance_size && + dleft < (wright - wleft)) { dx = offsetrect.left() - frame.rect.width(); snapped = True; } // snap right of other window? - else if (dright >= 0 && dright < resistance_size) { + else if (dright >= 0 && dright < resistance_size && + dright < (wright - wleft)) { dx = offsetrect.right() + 1; snapped = True; } @@ -3258,12 +3260,13 @@ void BlackboxWindow::doWindowSnapping(int &dx, int &dy) { dbottom = offsetrect.bottom() - wtop; // snap top of other window? - if (dtop >= 0 && dtop < resistance_size) { + if (dtop >= 0 && dtop < resistance_size && dtop < (wbottom - wtop)) { dy = offsetrect.top() - frame.rect.height(); snapped = True; } // snap bottom of other window? - else if (dbottom >= 0 && dbottom < resistance_size) { + else if (dbottom >= 0 && dbottom < resistance_size && + dbottom < (wbottom - wtop)) { dy = offsetrect.bottom() + 1; snapped = True; }