diff options
author | Brent Yorgey <byorgey@gmail.com> | 2008-02-01 13:04:30 +0100 |
---|---|---|
committer | Brent Yorgey <byorgey@gmail.com> | 2008-02-01 13:04:30 +0100 |
commit | 67af43c814819f0c836f796b6f1c61cc446143df (patch) | |
tree | 83d468e6c97d165da66fa77c1d062f2673845b98 /XMonad/Hooks/EwmhDesktops.hs | |
parent | 1fb7bc5eeeb14107abc57e50b33096f4758f5909 (diff) | |
download | XMonadContrib-67af43c814819f0c836f796b6f1c61cc446143df.tar.gz XMonadContrib-67af43c814819f0c836f796b6f1c61cc446143df.tar.xz XMonadContrib-67af43c814819f0c836f796b6f1c61cc446143df.zip |
WorkspaceCompare: some refactoring.
* Export WorkspaceCompare and WorkspaceSort types.
* Extract commonality in sort methods into mkWsSort, which creates
a workspace sort from a workspace comparison function.
* Rename getSortByTag to getSortByIndex, since it did not actually sort
by tag at all; it sorts by index of workspace tags in the user's config.
* Create a new getSortByTag function which actually does sort
lexicographically by tag.
* Enhance documentation.
darcs-hash:20080201120430-bd4d7-71310db2b8d4248ddfb77e3fa25dd0f3b98ea00b.gz
Diffstat (limited to 'XMonad/Hooks/EwmhDesktops.hs')
-rw-r--r-- | XMonad/Hooks/EwmhDesktops.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/XMonad/Hooks/EwmhDesktops.hs b/XMonad/Hooks/EwmhDesktops.hs index 231525d..5a3d030 100644 --- a/XMonad/Hooks/EwmhDesktops.hs +++ b/XMonad/Hooks/EwmhDesktops.hs @@ -38,17 +38,17 @@ import XMonad.Util.WorkspaceCompare -- > return () -- > -- > main = xmonad defaultConfig { logHook = myLogHook } --- +-- -- For more detailed instructions on editing the layoutHook see: -- -- "XMonad.Doc.Extending#The_log_hook_and_external_status_bars" --- | +-- | -- Notifies pagers and window lists, such as those in the gnome-panel -- of the current state of workspaces and windows. ewmhDesktopsLogHook :: X () ewmhDesktopsLogHook = withWindowSet $ \s -> do - sort' <- getSortByTag + sort' <- getSortByIndex let ws = sort' $ W.workspaces s let wins = W.allWindows s @@ -62,7 +62,7 @@ ewmhDesktopsLogHook = withWindowSet $ \s -> do -- Current desktop let curr = fromJust $ elemIndex (W.tag (W.workspace (W.current s))) $ map W.tag ws - + setCurrentDesktop curr setClientList wins @@ -70,11 +70,11 @@ ewmhDesktopsLogHook = withWindowSet $ \s -> do -- 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.current s : W.visible s) $ \x -> forM_ (W.integrate' (W.stack (W.workspace x))) $ \win -> do setWindowDesktop win curr - forM_ (W.hidden s) $ \w -> + 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 |