all repos — openbox @ 6fd25435889c33a627c181afca82361f1e901a8f

openbox fork - make it a bit more like ryudo

second stab at resistance
Dana Jansens danakj@orodu.net
commit

6fd25435889c33a627c181afca82361f1e901a8f

parent

e9a5c7158a8c0303e63bf3e14618eee705701cca

1 files changed, 8 insertions(+), 8 deletions(-)

jump to
M src/Window.ccsrc/Window.cc

@@ -3139,12 +3139,12 @@ if (wtop >= (signed)(winrect.y() - frame.rect.height() + 1) &&

wtop < (signed)(winrect.y() + winrect.height() - 1)) { // snap left of other window? - if (dleft < resistance_size && dleft > dright) { + if (dleft > 0 && dleft < resistance_size && dleft < dright) { dx = winrect.left() - frame.rect.width(); snapped = True; } // snap right of other window? - else if (dright < resistance_size) { + else if (dright > 0 && dright < resistance_size) { dx = winrect.right() + 1; snapped = True; }

@@ -3169,12 +3169,12 @@ if (wleft >= (signed)(winrect.x() - frame.rect.width() + 1) &&

wleft < (signed)(winrect.x() + winrect.width() - 1)) { // snap top of other window? - if (dtop < resistance_size && dtop > dbottom) { + if (dtop > 0 && dtop < resistance_size && dtop < dbottom) { dy = winrect.top() - frame.rect.height(); snapped = True; } // snap bottom of other window? - else if (dbottom < resistance_size) { + else if (dbottom > 0 && dbottom < resistance_size) { dy = winrect.bottom() + 1; snapped = True; }

@@ -3223,17 +3223,17 @@ dtop = wtop - srect.top(),

dbottom = wbottom - srect.bottom(); // snap left? - if (dleft < resistance_size && dleft > dright) + if (dleft > 0 && dleft < resistance_size && dleft > dright) dx = srect.left(); // snap right? - else if (dright < resistance_size) + else if (dright > 0 && dright < resistance_size) dx = srect.right() - frame.rect.width() + 1; // snap top? - if (dtop < resistance_size && dtop > dbottom) + if (dtop > 0 && dtop < resistance_size && dtop > dbottom) dy = srect.top(); // snap bottom? - else if (dbottom < resistance_size) + else if (dbottom > 0 && dbottom < resistance_size) dy = srect.bottom() - frame.rect.height() + 1; } }