summaryrefslogtreecommitdiffstats
path: root/XMonad/StackSet.hs
diff options
context:
space:
mode:
Diffstat (limited to 'XMonad/StackSet.hs')
-rw-r--r--XMonad/StackSet.hs27
1 files changed, 11 insertions, 16 deletions
diff --git a/XMonad/StackSet.hs b/XMonad/StackSet.hs
index da87ccf..dd91c15 100644
--- a/XMonad/StackSet.hs
+++ b/XMonad/StackSet.hs
@@ -39,10 +39,10 @@ module XMonad.StackSet (
tagMember, renameTag, member, findTag, mapWorkspace, mapLayout,
-- * Modifying the stackset
-- $modifyStackset
- insertUp, delete, delete', filter,
+ insertUp, delete, filter,
-- * Setting the master window
-- $settingMW
- swapUp, swapDown, swapMaster, shiftMaster, modify, modify', float, sink, -- needed by users
+ swapUp, swapDown, swapMaster, shiftMaster, modify, modify', -- needed by users
-- * Composite operations
-- $composite
shift, shiftWin,
@@ -55,7 +55,6 @@ import Prelude hiding (filter)
import Data.Function (on)
import Data.Maybe (listToMaybe,isJust,fromMaybe)
import qualified Data.List as L (deleteBy,find,splitAt,filter,nub)
-import qualified Data.Map as M (Map,insert,delete,empty)
-- $intro
--
@@ -134,7 +133,6 @@ import qualified Data.Map as M (Map,insert,delete,empty)
data StackSet i l a sid sd =
StackSet { current :: !(Screen i l a sid sd) -- ^ currently focused workspace
, visible :: [Screen i l a sid sd] -- ^ non-focused workspaces, visible in xinerama
- , floating :: M.Map a RationalRect -- ^ floating windows
} deriving (Show, Read, Eq)
-- | Visible workspaces, and their Xinerama screens.
@@ -195,7 +193,7 @@ abort x = error $ "xmonad: StackSet: " ++ x
--
new :: (Integral s) => l -> [i] -> [sd] -> StackSet i l a s sd
new l wids m | not (null wids) && length m <= length wids && not (null m)
- = StackSet cur visi M.empty
+ = StackSet cur visi
where (seen,_) = L.splitAt (length m) $ map (\i -> Workspace i l Nothing) wids
(cur:visi) = [ Screen i [] s sd | (i, s, sd) <- zip3 seen [0..] m ]
-- now zip up visibles with their screen id
@@ -415,7 +413,7 @@ mapWorkspace f s = s { current = updScr (current s)
-- | Map a function on all the layouts in the 'StackSet'.
mapLayout :: (l -> l') -> StackSet i l a s sd -> StackSet i l' a s sd
-mapLayout f (StackSet v vs m) = StackSet (fScreen v) (map fScreen vs) m
+mapLayout f (StackSet v vs) = StackSet (fScreen v) (map fScreen vs)
where
fScreen (Screen ws hd s sd) = Screen (fWorkspace ws) (map fWorkspace hd) s sd
fWorkspace (Workspace t l s) = Workspace t (f l) s
@@ -475,25 +473,22 @@ insertUp a s = if member a s then s else insert
--
-- * otherwise, delete doesn't affect the master.
--
-delete :: (Ord a, Eq s) => a -> StackSet i l a s sd -> StackSet i l a s sd
-delete w = sink w . delete' w
-
-- | Only temporarily remove the window from the stack, thereby not destroying special
-- information saved in the 'Stackset'
-delete' :: (Eq a, Eq s) => a -> StackSet i l a s sd -> StackSet i l a s sd
-delete' w s = mapWorkspace removeFromWorkspace s
+delete :: (Eq a, Eq s) => a -> StackSet i l a s sd -> StackSet i l a s sd
+delete w s = mapWorkspace removeFromWorkspace s
where removeFromWorkspace ws = ws { stack = stack ws >>= filter (/=w) }
------------------------------------------------------------------------
-- | Given a window, and its preferred rectangle, set it as floating
-- A floating window should already be managed by the 'StackSet'.
-float :: Ord a => a -> RationalRect -> StackSet i l a s sd -> StackSet i l a s sd
-float w r s = s { floating = M.insert w r (floating s) }
+--float :: Ord a => a -> RationalRect -> StackSet i l a s sd -> StackSet i l a s sd
+--float w r s = s { floating = M.insert w r (floating s) }
-- | Clear the floating status of a window
-sink :: Ord a => a -> StackSet i l a s sd -> StackSet i l a s sd
-sink w s = s { floating = M.delete w (floating s) }
+--sink :: Ord a => a -> StackSet i l a s sd -> StackSet i l a s sd
+--sink w s = s { floating = M.delete w (floating s) }
------------------------------------------------------------------------
-- $settingMW
@@ -546,7 +541,7 @@ shiftWin :: (Ord a, Eq a, Eq s, Eq i) => i -> a -> StackSet i l a s sd -> StackS
shiftWin n w s = case findTag w s of
Just from | n `tagMember` s && n /= from -> go from s
_ -> s
- where go from = onWorkspace n (insertUp w) . onWorkspace from (delete' w)
+ where go from = onWorkspace n (insertUp w) . onWorkspace from (delete w)
onWorkspace :: (Eq i, Eq s) => i -> (StackSet i l a s sd -> StackSet i l a s sd)
-> (StackSet i l a s sd -> StackSet i l a s sd)