aboutsummaryrefslogtreecommitdiffstats
path: root/Operations.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-06-12 17:42:53 +0200
committerDavid Roundy <droundy@darcs.net>2007-06-12 17:42:53 +0200
commit0244bff4b032f2e16b52fa1c745e0119d0dde2d2 (patch)
tree1be49bf57f39c52af50a1c14eedcf9a467b005e7 /Operations.hs
parentf4f0f537620208cddb90eb3f72efd15f7d9b6768 (diff)
downloadxmonad-0244bff4b032f2e16b52fa1c745e0119d0dde2d2.tar.gz
xmonad-0244bff4b032f2e16b52fa1c745e0119d0dde2d2.tar.xz
xmonad-0244bff4b032f2e16b52fa1c745e0119d0dde2d2.zip
add catchX to catch exceptions.
darcs-hash:20070612154253-72aca-b2c7e24b5e70a09feaebccd443aebbe37b568efa.gz
Diffstat (limited to 'Operations.hs')
-rw-r--r--Operations.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Operations.hs b/Operations.hs
index e03c0fd..fd85106 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -153,7 +153,7 @@ windows f = do
-- just the tiled windows:
-- now tile the windows on this workspace, modified by the gap
- rs <- runLayout l viewrect tiled -- `mplus` doLayout full viewrect tiled
+ rs <- runLayout l viewrect tiled `catchX` runLayout full viewrect tiled
mapM_ (uncurry tileWindow) rs
-- now the floating windows:
@@ -353,7 +353,7 @@ switchLayout = do
sendMessage :: Message a => a -> X ()
sendMessage a = do n <- (W.tag . W.workspace . W.current) `fmap` gets windowset
Just (l,ls) <- M.lookup n `fmap` gets layouts
- ml' <- modifyLayout l (SomeMessage a)
+ ml' <- modifyLayout l (SomeMessage a) `catchX` return (Just l)
whenJust ml' $ \l' -> do modify $ \s -> s { layouts = M.insert n (l',ls) (layouts s) }
refresh
@@ -362,7 +362,8 @@ sendMessage a = do n <- (W.tag . W.workspace . W.current) `fmap` gets windowset
broadcastMessage :: Message a => a -> X ()
broadcastMessage a = do
ol <- gets layouts
- nl <- T.forM ol $ \ (l,ls) -> maybe (l,ls) (flip (,) ls) `fmap` modifyLayout l (SomeMessage a)
+ nl <- T.forM ol $ \ (l,ls) -> maybe (l,ls) (flip (,) ls) `fmap`
+ (modifyLayout l (SomeMessage a) `catchX` return (Just l))
modify $ \s -> s { layouts = nl }
instance Message Event