summaryrefslogtreecommitdiffstats
path: root/XMonad/Operations.hs
diff options
context:
space:
mode:
authorDaniel Schoepe <daniel.schoepe@gmail.com>2009-11-06 12:50:50 +0100
committerDaniel Schoepe <daniel.schoepe@gmail.com>2009-11-06 12:50:50 +0100
commit9e65e39791460a438c759596768d65f6af9e05d7 (patch)
tree2a0d6f18800103fd8dd655e89fa3308e4314d5a5 /XMonad/Operations.hs
parent127096c17db48c14c07df9200dcbda59653e5e40 (diff)
downloadmetatile-9e65e39791460a438c759596768d65f6af9e05d7.tar
metatile-9e65e39791460a438c759596768d65f6af9e05d7.zip
Support for extensible state in contrib modules.
Ignore-this: d04ee1989313ed5710c94f9d7fda3f2a darcs-hash:20091106115050-7f603-c88ce5e468856afd9e4d458ed3b0a2cfa39e63b3
Diffstat (limited to 'XMonad/Operations.hs')
-rw-r--r--XMonad/Operations.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/XMonad/Operations.hs b/XMonad/Operations.hs
index fe124f3..f4a6bed 100644
--- a/XMonad/Operations.hs
+++ b/XMonad/Operations.hs
@@ -68,7 +68,7 @@ manage w = whenX (not <$> isClient w) $ withDisplay $ \d -> do
where i = W.tag $ W.workspace $ W.current ws
mh <- asks (manageHook . config)
- g <- fmap appEndo $ userCodeDef (Endo id) (runQuery mh w)
+ g <- appEndo <$> userCodeDef (Endo id) (runQuery mh w)
windows (g . f)
-- | unmanage. A window no longer exists, remove it from the window
@@ -413,9 +413,13 @@ restart :: String -> Bool -> X ()
restart prog resume = do
broadcastMessage ReleaseResources
io . flush =<< asks display
- args <- if resume then gets (("--resume":) . return . showWs . windowset) else return []
+ let wsData = show . W.mapLayout show . windowset
+ maybeShow (t, Right (PersistentExtension ext)) = Just (t, show ext)
+ maybeShow (t, Left str) = Just (t, str)
+ maybeShow _ = Nothing
+ extState = return . show . catMaybes . map maybeShow . M.toList . extensibleState
+ args <- if resume then gets (\s -> "--resume":wsData s:extState s) else return []
catchIO (executeFile prog True args Nothing)
- where showWs = show . W.mapLayout show
------------------------------------------------------------------------
-- | Floating layer support