summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2009-02-21 18:50:08 +0900
committerSam Spilsbury <smspillaz@gmail.com>2009-02-21 18:50:08 +0900
commitd3ae75668c49552181c2be72b8d838e0650eb20b (patch)
tree860e2b3d94212077c146be9cb69018050c179dbf
parent6b12eba69bc8e6ba1d0a3b0dc36461a906ffcea6 (diff)
downloadtile-d3ae75668c49552181c2be72b8d838e0650eb20b.tar.gz
tile-d3ae75668c49552181c2be72b8d838e0650eb20b.tar.bz2
Check for restore mode before creating a new tiler object. This fixes a crash. Also, fix restore mode calculation
-rw-r--r--tile.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/tile.cpp b/tile.cpp
index b77610d..4e08092 100644
--- a/tile.cpp
+++ b/tile.cpp
@@ -651,8 +651,11 @@ TileScreen::restoreTile (CompWindowExtents &border,
{
tw->placeWin (tw->tiler->saved.x (), tw->tiler->saved.y (),
tw->tiler->saved.width (), tw->tiler->saved.height ());
+ /* We must configure here as we remove the tiler object */
+ tw->tiler->configure (w, TileScreen::Restore);
tilers.remove (tw->tiler);
delete tw->tiler;
+ tw->tiler = NULL;
}
}
}
@@ -782,7 +785,7 @@ TileScreen::applyTiling (CompAction *action,
if (w->input ().bottom > border.bottom)
border.bottom = w->input ().bottom;
- if (!tw->tiler)
+ if (!tw->tiler && type != Restore)
{
tw->tiler = new Tiler;
tw->tiler->save (w);
@@ -792,12 +795,17 @@ TileScreen::applyTiling (CompAction *action,
}
}
+ if (type == Restore)
+ {
+ restoreTile (border, workArea, count);
+ return true;
+ }
+
/* TODO: Should probably be replaced by a propper extension manager */
switch (type)
{
case Restore:
- restoreTile (border, workArea, count);
break;
case Square:
squareTile (border, workArea, count);