summaryrefslogtreecommitdiff
path: root/tile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tile.cpp')
-rw-r--r--tile.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/tile.cpp b/tile.cpp
index 0a5cde6..d3caee3 100644
--- a/tile.cpp
+++ b/tile.cpp
@@ -2,7 +2,7 @@
*
* Compiz tile plugin
*
- * tile.cp
+ * tile.cpp
*
* Copyright (c) 2008 Sam Spilsbury <smspillaz@gmail.com>
*
@@ -799,6 +799,24 @@ TileScreen::cascadeTile (CompWindowExtents &border,
XRectangle &workArea,
int count)
{
+ int delta = optionGetCascadeDelta ();
+ int currentX = workArea.x;
+ int currentY = workArea.y;
+ int winWidth = workArea.width - delta * (count -1);
+ int winHeight = workArea.height - delta * (count -1);
+
+ foreach (CompWindow *w, screen->windows ())
+ {
+ TILE_WINDOW (w);
+
+ if (!tw->tiler)
+ continue;
+
+ tw->placeWin (currentX, currentY, winWidth, winHeight);
+
+ currentX += delta;
+ currentY += delta;
+ }
}
bool
@@ -1091,16 +1109,16 @@ TileScreen::TileScreen (CompScreen *screen) :
tileInitiate (VerticalKey, Vertical);
tileInitiate (ExpandKey, Restore);
tileInitiate (OrganicKey, Restore);
- tileInitiate (CascadeKey, Restore);
+ tileInitiate (CascadeKey, Cascade);
tileInitiate (RestoreEdge, Restore);
tileInitiate (SquareEdge, Square);
tileInitiate (EvenEdge, Restore);
- tileInitiate (HorizontalEdge, Restore);
- tileInitiate (VerticalEdge, Restore);
+ tileInitiate (HorizontalEdge, Horizontal);
+ tileInitiate (VerticalEdge, Vertical);
tileInitiate (ExpandEdge, Restore);
tileInitiate (OrganicEdge, Restore);
- tileInitiate (CascadeEdge, Restore);
+ tileInitiate (CascadeEdge, Cascade);
#undef tileInitiate
}