diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-05-08 17:12:00 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-05-08 17:12:00 +0200 |
commit | f4c2b23fecc863218a395d731bd18c2afd164db4 (patch) | |
tree | 497c519fa8f5bf9670d0b36338e2917c7b631130 /Operations.hs | |
parent | 22db9163bf3b003162ccdf3272a27b77f89ad7a0 (diff) | |
download | xmonad-f4c2b23fecc863218a395d731bd18c2afd164db4.tar.gz xmonad-f4c2b23fecc863218a395d731bd18c2afd164db4.tar.xz xmonad-f4c2b23fecc863218a395d731bd18c2afd164db4.zip |
Make 'index' return Nothing, rather than error
darcs-hash:20070508151200-a5988-3da2bb925de6c610ed9b7a5ab5bccedb3483d032.gz
Diffstat (limited to 'Operations.hs')
-rw-r--r-- | Operations.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Operations.hs b/Operations.hs index ac5bcc9..c890bd5 100644 --- a/Operations.hs +++ b/Operations.hs @@ -48,7 +48,7 @@ refresh = do flip mapM_ (M.assocs (W.screen2ws ws)) $ \(scn, n) -> do let sc = genericIndex xinesc scn -- temporary coercion! (Just l) = fmap fst $ M.lookup n fls - mapM_ (\(w, rect) -> io $ moveWindowInside d w rect) $ (doLayout l) sc $ W.index n ws + whenJust (W.index n ws) $ mapM_ (\(w, rect) -> io $ moveWindowInside d w rect) . doLayout l sc whenJust (W.peekStack n ws) (io . raiseWindow d) whenJust (W.peek ws) setFocus clearEnterEvents @@ -235,7 +235,7 @@ setFocus w = do -- clear mouse button grab and border on other windows flip mapM_ (W.visibleWorkspaces ws) $ \n -> do - flip mapM_ (W.index n ws) $ \otherw -> do + flip mapM_ (fromMaybe [] $ W.index n ws) $ \otherw -> do setButtonGrab True otherw io $ setWindowBorder dpy otherw (color_pixel nbc) @@ -297,7 +297,7 @@ view n = do ws' <- gets workspace -- If the old workspace isn't visible anymore, we have to hide the windows -- in case we're switching to an empty workspace. - when (m `notElem` W.visibleWorkspaces ws') (mapM_ hide (W.index m ws)) + when (m `notElem` W.visibleWorkspaces ws') $ maybe (return ()) (mapM_ hide) $ W.index m ws clearEnterEvents setTopFocus |