diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-05 02:00:31 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-05 02:00:31 +0200 |
commit | fef4121478dee22f87f010dff820b3f5aa195c44 (patch) | |
tree | c5a350a84c25f3199b7aceccf8b7534de7e69047 /Main.hs | |
parent | fb60d205050cf17ce4778e1279ea8fdb8ae57ef3 (diff) | |
download | metatile-fef4121478dee22f87f010dff820b3f5aa195c44.tar metatile-fef4121478dee22f87f010dff820b3f5aa195c44.zip |
Make WindowSet serialization robust to layout changes
darcs-hash:20071005000031-a5988-c8ab82b01a70dc7526fa64c71edc7673dbfab4db
Diffstat (limited to 'Main.hs')
-rw-r--r-- | Main.hs | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -52,9 +52,16 @@ main = do let initialWinset = new defaultLayout workspaces $ zipWith SD xinesc gaps - winset | ("--resume" : s : _) <- args - , [(x, "")] <- reads s = W.ensureTags defaultLayout workspaces x - | otherwise = initialWinset + maybeRead s = case reads s of + [(x, "")] -> Just x + _ -> Nothing + + winset = fromMaybe initialWinset $ do + ("--resume" : s : _) <- return args + ws <- maybeRead s + return . W.ensureTags defaultLayout workspaces + $ W.mapLayout (fromMaybe defaultLayout . maybeRead) ws + gaps = take (length xinesc) $ defaultGaps ++ repeat (0,0,0,0) cf = XConf |