aboutsummaryrefslogtreecommitdiff
path: root/src/MinOverlapPlacement.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/MinOverlapPlacement.cc')
-rw-r--r--src/MinOverlapPlacement.cc28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/MinOverlapPlacement.cc b/src/MinOverlapPlacement.cc
index 1ace23a..e7e80cb 100644
--- a/src/MinOverlapPlacement.cc
+++ b/src/MinOverlapPlacement.cc
@@ -72,12 +72,14 @@ bool MinOverlapPlacement::placeWindow(
72 for (; it != it_end; ++it) { 72 for (; it != it_end; ++it) {
73 73
74 // get the dimensions of the window 74 // get the dimensions of the window
75 int bottom = (*it)->y() + (*it)->height() + 75 int left = (*it)->x() - (*it)->xOffset();
76 2*(*it)->frame().window().borderWidth(); 76 int top = (*it)->y() - (*it)->yOffset();
77 int top = (*it)->y(); 77 int right = left + (*it)->width() +
78 int right = (*it)->x() + (*it)->width() + 78 2*(*it)->frame().window().borderWidth() +
79 2*(*it)->frame().window().borderWidth(); 79 (*it)->widthOffset();
80 int left = (*it)->x(); 80 int bottom = top + (*it)->height() +
81 2*(*it)->frame().window().borderWidth() +
82 (*it)->heightOffset();
81 83
82 // go through the list of regions 84 // go through the list of regions
83 // if this window overlaps that region and the new window still fits, 85 // if this window overlaps that region and the new window still fits,
@@ -143,12 +145,14 @@ bool MinOverlapPlacement::placeWindow(
143 for (; it != windowlist.rend(); ++it) { 145 for (; it != windowlist.rend(); ++it) {
144 146
145 // get the dimensions of the window 147 // get the dimensions of the window
146 int bottom = (*it)->y() + (*it)->height() + 148 int left = (*it)->x() - (*it)->xOffset();
147 2*(*it)->frame().window().borderWidth(); 149 int top = (*it)->y() - (*it)->yOffset();
148 int top = (*it)->y(); 150 int right = left + (*it)->width() +
149 int right = (*it)->x() + (*it)->width() + 151 2*(*it)->frame().window().borderWidth() +
150 2*(*it)->frame().window().borderWidth(); 152 (*it)->widthOffset();
151 int left = (*it)->x(); 153 int bottom = top + (*it)->height() +
154 2*(*it)->frame().window().borderWidth() +
155 (*it)->heightOffset();
152 156
153 // get the coordinates of the overlap region 157 // get the coordinates of the overlap region
154 int min_right = (right > reg_it->x + win_w) ? 158 int min_right = (right > reg_it->x + win_w) ?