aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Main.hsc
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
commit795fed842c57d980e7644bb2df9eb66078ae6d44 (patch)
tree2a0d6f18800103fd8dd655e89fa3308e4314d5a5 /XMonad/Main.hsc
parentc04a3021b5e95603f7d80732a4bfafb60a4ef261 (diff)
downloadxmonad-795fed842c57d980e7644bb2df9eb66078ae6d44.tar.gz
xmonad-795fed842c57d980e7644bb2df9eb66078ae6d44.tar.xz
xmonad-795fed842c57d980e7644bb2df9eb66078ae6d44.zip
Support for extensible state in contrib modules.
Ignore-this: d04ee1989313ed5710c94f9d7fda3f2a darcs-hash:20091106115050-7f603-c88ce5e468856afd9e4d458ed3b0a2cfa39e63b3.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Main.hsc18
1 files changed, 12 insertions, 6 deletions
diff --git a/XMonad/Main.hsc b/XMonad/Main.hsc
index 499be54..e7fc768 100644
--- a/XMonad/Main.hsc
+++ b/XMonad/Main.hsc
@@ -15,6 +15,7 @@
module XMonad.Main (xmonad) where
+import Control.Arrow (second)
import Data.Bits
import Data.List ((\\))
import qualified Data.Map as M
@@ -93,7 +94,6 @@ xmonad initxmc = do
let layout = layoutHook xmc
lreads = readsLayout layout
initialWinset = new layout (workspaces xmc) $ map SD xinesc
-
maybeRead reads' s = case reads' s of
[(x, "")] -> Just x
_ -> Nothing
@@ -103,6 +103,10 @@ xmonad initxmc = do
ws <- maybeRead reads s
return . W.ensureTags layout (workspaces xmc)
$ W.mapLayout (fromMaybe layout . maybeRead lreads) ws
+ extState = fromMaybe M.empty $ do
+ ("--resume" : _ : dyns : _) <- return args
+ vals <- maybeRead reads dyns
+ return . M.fromList . map (second Left) $ vals
cf = XConf
{ display = dpy
@@ -114,12 +118,14 @@ xmonad initxmc = do
, buttonActions = mouseBindings xmc xmc
, mouseFocused = False
, mousePosition = Nothing }
- st = XState
- { windowset = initialWinset
- , mapped = S.empty
- , waitingUnmap = M.empty
- , dragging = Nothing }
+ st = XState
+ { windowset = initialWinset
+ , mapped = S.empty
+ , waitingUnmap = M.empty
+ , dragging = Nothing
+ , extensibleState = extState
+ }
allocaXEvent $ \e ->
runX cf st $ do