diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-04-14 09:39:14 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-04-14 09:39:14 +0000 |
| commit | d00ef145828941dc15c31bd7c3fc2f69f29c2955 (patch) | |
| tree | 6324e064283f8d7581015148301040fb817a48f2 /src/Window.cc | |
| parent | bb1a97327b08fa5c1b8025083fc39498b3256c84 (diff) | |
made shaded windows snap properly at their bottom, using their shaded height.
window.getHeight() now returns the different/correct value when a window is shaded.
Diffstat (limited to 'src/Window.cc')
| -rw-r--r-- | src/Window.cc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/Window.cc b/src/Window.cc index b81f1b90..0a033932 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -2804,15 +2804,18 @@ void OpenboxWindow::motionNotifyEvent(XMotionEvent *me) { dy -= frame.border_w; int snap_distance = screen->getEdgeSnapThreshold(); + // width/height of the snapping window + unsigned int snap_w = frame.width + (frame.border_w * 2); + unsigned int snap_h = getHeight() + (frame.border_w * 2); if (snap_distance) { - int drx = screen->getWidth() - (dx + frame.snap_w); + int drx = screen->getWidth() - (dx + snap_w); if (dx < drx && (dx > 0 && dx < snap_distance) || (dx < 0 && dx > -snap_distance) ) dx = 0; else if ( (drx > 0 && drx < snap_distance) || (drx < 0 && drx > -snap_distance) ) - dx = screen->getWidth() - frame.snap_w; + dx = screen->getWidth() - snap_w; int dtty, dbby, dty, dby; switch (screen->getToolbarPlacement()) { @@ -2831,14 +2834,14 @@ void OpenboxWindow::motionNotifyEvent(XMotionEvent *me) { } dty = dy - dtty; - dby = dbby - (dy + frame.snap_h); + dby = dbby - (dy + snap_h); if ( (dy > 0 && dty < snap_distance) || (dy < 0 && dty > -snap_distance) ) dy = dtty; else if ( (dby > 0 && dby < snap_distance) || (dby < 0 && dby > -snap_distance) ) - dy = dbby - frame.snap_h; + dy = dbby - snap_h; } if (screen->doOpaqueMove()) { @@ -3148,9 +3151,6 @@ void OpenboxWindow::upsize(void) { frame.width = client.width + (frame.mwm_border_w * 2); frame.height = frame.y_handle + frame.handle_h; - - frame.snap_w = frame.width + (frame.border_w * 2); - frame.snap_h = frame.height + (frame.border_w * 2); } @@ -3172,9 +3172,6 @@ void OpenboxWindow::downsize(void) { - frame.handle_h - (decorations.handle ? frame.border_w : 0); frame.y_handle = frame.border_h + frame.y_border + frame.border_w; - - frame.snap_w = frame.width + (frame.border_w * 2); - frame.snap_h = frame.height + (frame.border_w * 2); } |
