summaryrefslogtreecommitdiff
path: root/tile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tile.cpp')
-rw-r--r--tile.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/tile.cpp b/tile.cpp
index 817e84a..434324c 100644
--- a/tile.cpp
+++ b/tile.cpp
@@ -711,6 +711,23 @@ TileScreen::horizontalTile (CompWindowExtents &border,
XRectangle &workArea,
int count)
{
+ int winWidth = workArea.width;
+ int winHeight = workArea.height / count;
+ int x = workArea.x;
+ int i = 0;
+
+ foreach (CompWindow *w, screen->windows ())
+ {
+ TILE_WINDOW (w);
+
+ if (!tw->tiler)
+ continue;
+
+ tw->placeWin (x, workArea.y + (i * winHeight),
+ winWidth, winHeight);
+
+ i++;
+ }
}
void
@@ -718,6 +735,23 @@ TileScreen::verticalTile (CompWindowExtents &border,
XRectangle &workArea,
int count)
{
+ int winWidth = workArea.width / count;
+ int winHeight = workArea.height;
+ int y = workArea.y;
+ int i = 0;
+
+ foreach (CompWindow *w, screen->windows ())
+ {
+ TILE_WINDOW (w);
+
+ if (!tw->tiler)
+ continue;
+
+ tw->placeWin (workArea.x + (winWidth * i),
+ y, winWidth, winHeight);
+
+ i++;
+ }
}
/* Adapated from scale.c
@@ -1047,8 +1081,8 @@ TileScreen::TileScreen (CompScreen *screen) :
tileInitiate (RestoreKey, Restore);
tileInitiate (SquareKey, Square);
tileInitiate (EvenKey, Restore);
- tileInitiate (HorizontalKey, Restore);
- tileInitiate (VerticalKey, Restore);
+ tileInitiate (HorizontalKey, Horizontal);
+ tileInitiate (VerticalKey, Vertical);
tileInitiate (ExpandKey, Restore);
tileInitiate (OrganicKey, Restore);
tileInitiate (CascadeKey, Restore);