summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-08-06 12:03:08 +0000
committerDana Jansens <danakj@orodu.net>2002-08-06 12:03:08 +0000
commitb8c0c7af126928fde8c4bb4a90d10f6d86fd0d75 (patch)
tree91cc0e9c3dd04330db51ed7f0a95858639500643 /src
parenta2a348c233247315e39c8a677064da51de57a9d5 (diff)
dont snap things around crazy with small windows in resistance mode
Diffstat (limited to 'src')
-rw-r--r--src/Window.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Window.cc b/src/Window.cc
index dc09a658..fa49ec21 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -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;
}