aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorakir <akir>2004-11-07 09:30:59 (GMT)
committerakir <akir>2004-11-07 09:30:59 (GMT)
commit5225cf192fbb4115bcc9bad23b267cab2f6bdb1e (patch)
tree5c2f8c999f113b56889c3ef57ca1d0b4acf0a8df /src/Window.cc
parent63f3429ea7a4ea4630d326ff980ecafb953dcfb5 (diff)
downloadfluxbox-5225cf192fbb4115bcc9bad23b267cab2f6bdb1e.zip
fluxbox-5225cf192fbb4115bcc9bad23b267cab2f6bdb1e.tar.bz2
fixed a problem with the snapping-windows code:
decorationless windows have a borderWidth of 0 and thus the snapping was calculated wrong.
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Window.cc b/src/Window.cc
index ccf0748..8265f91 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.305 2004/10/28 19:13:30 akir Exp $ 25// $Id: Window.cc,v 1.306 2004/11/07 09:30:59 akir Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -3047,12 +3047,15 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
3047 int dy = screen().getEdgeSnapThreshold() + 1; 3047 int dy = screen().getEdgeSnapThreshold() + 1;
3048 3048
3049 // we only care about the left/top etc that includes borders 3049 // we only care about the left/top etc that includes borders
3050 int borderW = frame().window().borderWidth(); 3050 int borderW = 0;
3051
3052 if (decorationMask() & DECORM_ENABLED)
3053 borderW = frame().window().borderWidth();
3051 3054
3052 int top = orig_top; // orig include the borders 3055 int top = orig_top; // orig include the borders
3053 int left = orig_left; 3056 int left = orig_left;
3054 int right = orig_left + width() + 2*borderW; 3057 int right = orig_left + width() + 2 * borderW;
3055 int bottom = orig_top + height() + 2*borderW; 3058 int bottom = orig_top + height() + 2 * borderW;
3056 3059
3057 ///////////////////////////////////// 3060 /////////////////////////////////////
3058 // begin by checking the screen (or Xinerama head) edges 3061 // begin by checking the screen (or Xinerama head) edges
@@ -3083,14 +3086,16 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
3083 Workspace::Windows::iterator it = wins.begin(); 3086 Workspace::Windows::iterator it = wins.begin();
3084 Workspace::Windows::iterator it_end = wins.end(); 3087 Workspace::Windows::iterator it_end = wins.end();
3085 3088
3089 unsigned int bw;
3086 for (; it != it_end; it++) { 3090 for (; it != it_end; it++) {
3087 if ((*it) == this) continue; // skip myself 3091 if ((*it) == this) continue; // skip myself
3092 bw = (*it)->decorationMask() & DECORM_ENABLED ? (*it)->frame().window().borderWidth() : 0;
3088 3093
3089 snapToWindow(dx, dy, left, right, top, bottom, 3094 snapToWindow(dx, dy, left, right, top, bottom,
3090 (*it)->x(), 3095 (*it)->x(),
3091 (*it)->x() + (*it)->width() + 2*borderW, 3096 (*it)->x() + (*it)->width() + 2 * bw,
3092 (*it)->y(), 3097 (*it)->y(),
3093 (*it)->y() + (*it)->height() + 2*borderW); 3098 (*it)->y() + (*it)->height() + 2 * bw);
3094 } 3099 }
3095 3100
3096 // commit 3101 // commit