no need to try the same screen edge twice for snapping when full max is on
This commit is contained in:
parent
9ccebf1118
commit
e149ab6c29
1 changed files with 19 additions and 17 deletions
|
@ -2582,26 +2582,28 @@ void BlackboxWindow::motionNotifyEvent(XMotionEvent *me) {
|
||||||
else if (dbottom < snap_distance)
|
else if (dbottom < snap_distance)
|
||||||
dy = srect.bottom() - frame.rect.height() + 1;
|
dy = srect.bottom() - frame.rect.height() + 1;
|
||||||
|
|
||||||
srect = screen->getRect(); // now get the full screen
|
if (! screen->doFullMax()) {
|
||||||
|
srect = screen->getRect(); // now get the full screen
|
||||||
|
|
||||||
dleft = std::abs(wleft - srect.left()),
|
dleft = std::abs(wleft - srect.left()),
|
||||||
dright = std::abs(wright - srect.right()),
|
dright = std::abs(wright - srect.right()),
|
||||||
dtop = std::abs(wtop - srect.top()),
|
dtop = std::abs(wtop - srect.top()),
|
||||||
dbottom = std::abs(wbottom - srect.bottom());
|
dbottom = std::abs(wbottom - srect.bottom());
|
||||||
|
|
||||||
// snap left?
|
// snap left?
|
||||||
if (dleft < snap_distance && dleft <= dright)
|
if (dleft < snap_distance && dleft <= dright)
|
||||||
dx = srect.left();
|
dx = srect.left();
|
||||||
// snap right?
|
// snap right?
|
||||||
else if (dright < snap_distance)
|
else if (dright < snap_distance)
|
||||||
dx = srect.right() - frame.rect.width() + 1;
|
dx = srect.right() - frame.rect.width() + 1;
|
||||||
|
|
||||||
// snap top?
|
// snap top?
|
||||||
if (dtop < snap_distance && dtop <= dbottom)
|
if (dtop < snap_distance && dtop <= dbottom)
|
||||||
dy = srect.top();
|
dy = srect.top();
|
||||||
// snap bottom?
|
// snap bottom?
|
||||||
else if (dbottom < snap_distance)
|
else if (dbottom < snap_distance)
|
||||||
dy = srect.bottom() - frame.rect.height() + 1;
|
dy = srect.bottom() - frame.rect.height() + 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (screen->doOpaqueMove()) {
|
if (screen->doOpaqueMove()) {
|
||||||
|
|
Loading…
Reference in a new issue