- RECT_SET(area[i], strut[i].left, strut[i].top,
- screen_physical_size.width - (strut[i].left +
- strut[i].right),
- screen_physical_size.height - (strut[i].top +
- strut[i].bottom));
-
-/*
- #ifdef XINERAMA
- if (isXineramaActive()) {
- // keep each of the ximerama-defined areas inside the strut
- RectList::iterator xit, xend = xineramaUsableArea.end();
- for (xit = xineramaUsableArea.begin(); xit != xend; ++xit) {
- if (xit->x() < usableArea.x()) {
- xit->setX(usableArea.x());
- xit->setWidth(xit->width() - usableArea.x());
- }
- if (xit->y() < usableArea.y()) {
- xit->setY(usableArea.y());
- xit->setHeight(xit->height() - usableArea.y());
- }
- if (xit->x() + xit->width() > usableArea.width())
- xit->setWidth(usableArea.width() - xit->x());
- if (xit->y() + xit->height() > usableArea.height())
- xit->setHeight(usableArea.height() - xit->y());
- }
- }
- #endif // XINERAMA
-*/
- if (!RECT_EQUAL(old_area, area[i])) {
- /* the area has changed, adjust all the maximized windows */
+ area[i][screen_num_monitors].x += s.left;
+ area[i][screen_num_monitors].width -= s.left;
+ }
+ if (s.top) {
+ int o;
+
+ /* find the left-most xin heads, i do this in 2 loops :| */
+ o = area[i][0].y;
+ for (x = 1; x < screen_num_monitors; ++x)
+ o = MIN(o, area[i][x].y);
+
+ for (x = 0; x < screen_num_monitors; ++x) {
+ int edge = o + s.top - area[i][x].y;
+ if (edge > 0) {
+ area[i][x].y += edge;
+ area[i][x].height -= edge;
+ }
+ }
+
+ area[i][screen_num_monitors].y += s.top;
+ area[i][screen_num_monitors].height -= s.top;
+ }
+ if (s.right) {
+ int o;
+
+ /* find the bottom-most xin heads, i do this in 2 loops :| */
+ o = area[i][0].x + area[i][0].width - 1;
+ for (x = 1; x < screen_num_monitors; ++x)
+ o = MAX(o, area[i][x].x + area[i][x].width - 1);
+
+ for (x = 0; x < screen_num_monitors; ++x) {
+ int edge = (area[i][x].x + area[i][x].width - 1) -
+ (o - s.right);
+ if (edge > 0)
+ area[i][x].width -= edge;
+ }
+
+ area[i][screen_num_monitors].width -= s.right;
+ }
+ if (s.bottom) {
+ int o;
+
+ /* find the bottom-most xin heads, i do this in 2 loops :| */
+ o = area[i][0].y + area[i][0].height - 1;
+ for (x = 1; x < screen_num_monitors; ++x)
+ o = MAX(o, area[i][x].y + area[i][x].height - 1);
+
+ for (x = 0; x < screen_num_monitors; ++x) {
+ int edge = (area[i][x].y + area[i][x].height - 1) -
+ (o - s.bottom);
+ if (edge > 0)
+ area[i][x].height -= edge;
+ }
+
+ area[i][screen_num_monitors].height -= s.bottom;
+ }
+
+ /* XXX when dealing with partial struts, if its in a single
+ xinerama area, then only subtract it from that area's space
+ for (x = 0; x < screen_num_monitors; ++x) {