summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2009-02-22 00:36:16 +0900
committerSam Spilsbury <smspillaz@gmail.com>2009-02-22 00:36:16 +0900
commit528435cafc07a61e1d00d24df6092d25b5c5a963 (patch)
tree1da660cc47edeb9e2424a0de1363e3e5beea1cf2
parent7ebd272636bdf7da3b5ff0e73bc1f2e4d5c657c9 (diff)
downloadtile-528435cafc07a61e1d00d24df6092d25b5c5a963.tar.gz
tile-528435cafc07a61e1d00d24df6092d25b5c5a963.tar.bz2
Take into account border size when tiling
-rw-r--r--tile.cpp26
-rw-r--r--tile.h6
2 files changed, 24 insertions, 8 deletions
diff --git a/tile.cpp b/tile.cpp
index 1c361fb..7a9fceb 100644
--- a/tile.cpp
+++ b/tile.cpp
@@ -687,10 +687,11 @@ TileScreen::squareTile (CompWindowExtents &border,
if (!tw->tiler)
continue;
+
/* Put the window at the current slot */
- tw->placeWin (currentX, currentY,
- winWidth,
- winHeight);
+ tw->placeWin (currentX + border.left, currentY + border.top,
+ winWidth - (border.left + border.right),
+ winHeight - (border.top + border.bottom));
/* If we have reached countX - 1 ... */
if (i_x == countX - 1)
@@ -729,8 +730,11 @@ TileScreen::horizontalTile (CompWindowExtents &border,
if (!tw->tiler)
continue;
- tw->placeWin (x, workArea.y + (i * winHeight),
- winWidth, winHeight);
+ tw->placeWin (x + border.left,
+ workArea.y + border.top +
+ (i * (winHeight - (border.top + border.bottom))),
+ winWidth - (border.left + border.right),
+ winHeight - (border.top + border.bottom));
i++;
}
@@ -753,8 +757,11 @@ TileScreen::verticalTile (CompWindowExtents &border,
if (!tw->tiler)
continue;
- tw->placeWin (workArea.x + (winWidth * i),
- y, winWidth, winHeight);
+ tw->placeWin (workArea.x + border.left
+ + (i * (winWidth - (border.left + border.right))),
+ y + border.top,
+ winWidth - (border.left + border.right),
+ winHeight - (border.top + border.bottom));
i++;
}
@@ -812,7 +819,10 @@ TileScreen::cascadeTile (CompWindowExtents &border,
if (!tw->tiler)
continue;
- tw->placeWin (currentX, currentY, winWidth, winHeight);
+ tw->placeWin (currentX + border.left,
+ currentY + border.top,
+ winWidth - (border.left + border.right),
+ winHeight - (border.top + border.bottom));
currentX += delta;
currentY += delta;
diff --git a/tile.h b/tile.h
index 81a0e57..5ed6faa 100644
--- a/tile.h
+++ b/tile.h
@@ -38,6 +38,12 @@
#include <cmath>
+#define WIN_REAL_X(w) (w->x () - w->input ().left)
+#define WIN_REAL_Y(w) (w->y () - w->input ().top)
+
+#define WIN_REAL_W(w) (w->width () + (w->input ().left + w->input ().right))
+#define WIN_REAL_H(w) (w->height () + (w->input ().top + w->input ().bottom))
+
class Tiler;
class TileScreen :