diff options
author | rupa <rupa@lrrr.us> | 2008-12-24 05:55:09 +0100 |
---|---|---|
committer | rupa <rupa@lrrr.us> | 2008-12-24 05:55:09 +0100 |
commit | e4e789ddadfb510fe355078c97ac081bbcd4ed72 (patch) | |
tree | b82aa933d741d4bdf7b61d20175e5a5281a57553 | |
parent | 051e381e2267b8dbeb597e9b56753eafa23c7654 (diff) | |
download | XMonadContrib-e4e789ddadfb510fe355078c97ac081bbcd4ed72.tar.gz XMonadContrib-e4e789ddadfb510fe355078c97ac081bbcd4ed72.tar.xz XMonadContrib-e4e789ddadfb510fe355078c97ac081bbcd4ed72.zip |
fix-fromJust-errors
bogner wrote all this stuff and i just tested it.
I had:
myLogHook
darcs-hash:20081224045509-c0f70-712c12701c410fcc4715771c2566320b1110794b.gz
-rw-r--r-- | XMonad/Hooks/EwmhDesktops.hs | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/XMonad/Hooks/EwmhDesktops.hs b/XMonad/Hooks/EwmhDesktops.hs index 40415c6..2340efd 100644 --- a/XMonad/Hooks/EwmhDesktops.hs +++ b/XMonad/Hooks/EwmhDesktops.hs @@ -82,26 +82,28 @@ ewmhDesktopsLogHookCustom f = withWindowSet $ \s -> do -- Names thereof setDesktopNames (map W.tag ws) - -- Current desktop - let curr = fromJust $ elemIndex (W.currentTag s) $ map W.tag ws - - setCurrentDesktop curr - -- all windows, with focused windows last let wins = nub . concatMap (maybe [] (\(W.Stack x l r)-> reverse l ++ r ++ [x]) . W.stack) $ ws setClientList wins - -- Per window Desktop - -- To make gnome-panel accept our xinerama stuff, we display - -- all visible windows on the current desktop. - forM_ (W.current s : W.visible s) $ \x -> - forM_ (W.integrate' (W.stack (W.workspace x))) $ \win -> do - setWindowDesktop win curr + -- Current desktop + case (elemIndex (W.currentTag s) $ map W.tag ws) of + Nothing -> return () + Just curr -> do + setCurrentDesktop curr + + -- Per window Desktop + -- To make gnome-panel accept our xinerama stuff, we display + -- all visible windows on the current desktop. + forM_ (W.current s : W.visible s) $ \x -> + forM_ (W.integrate' (W.stack (W.workspace x))) $ \win -> do + setWindowDesktop win curr forM_ (W.hidden s) $ \w -> - let wn = fromJust $ elemIndex (W.tag w) (map W.tag ws) in - forM_ (W.integrate' (W.stack w)) $ \win -> do - setWindowDesktop win wn + case elemIndex (W.tag w) (map W.tag ws) of + Nothing -> return () + Just wn -> forM_ (W.integrate' (W.stack w)) $ \win -> do + setWindowDesktop win wn setActiveWindow |