From e4e789ddadfb510fe355078c97ac081bbcd4ed72 Mon Sep 17 00:00:00 2001 From: rupa Date: Wed, 24 Dec 2008 05:55:09 +0100 Subject: fix-fromJust-errors bogner wrote all this stuff and i just tested it. I had: myLogHook darcs-hash:20081224045509-c0f70-712c12701c410fcc4715771c2566320b1110794b.gz --- XMonad/Hooks/EwmhDesktops.hs | 30 ++++++++++++++++-------------- 1 file 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 -- cgit v1.2.3