aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions/Plane.hs
diff options
context:
space:
mode:
authorleoserra <leoserra@minaslivre.org>2008-07-06 19:53:03 +0200
committerleoserra <leoserra@minaslivre.org>2008-07-06 19:53:03 +0200
commitfecca6037b57d3d1d19c050ac529aac2a6461c6d (patch)
treecfde3b475adacbe63dc9e9968204793a20a982b7 /XMonad/Actions/Plane.hs
parentbb5969422f22df0f0597c540fa5171606941cb60 (diff)
downloadXMonadContrib-fecca6037b57d3d1d19c050ac529aac2a6461c6d.tar.gz
XMonadContrib-fecca6037b57d3d1d19c050ac529aac2a6461c6d.tar.xz
XMonadContrib-fecca6037b57d3d1d19c050ac529aac2a6461c6d.zip
XMonad.Actions.Plane.Linear
darcs-hash:20080706175303-3225b-c65a1f082dd8dc9866fb6a6d2ce5e6abd525c571.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Actions/Plane.hs22
1 files changed, 16 insertions, 6 deletions
diff --git a/XMonad/Actions/Plane.hs b/XMonad/Actions/Plane.hs
index 7e65117..9dca7d2 100644
--- a/XMonad/Actions/Plane.hs
+++ b/XMonad/Actions/Plane.hs
@@ -71,6 +71,7 @@ data Limits
-- to the next region.
| Circular -- ^ If you try to move, you'll get to the other edge, on the
-- other side.
+ | Linear -- ^ The plan comes as a row.
deriving Eq
-- | The number of lines in which the workspaces will be arranged. It's
@@ -137,6 +138,9 @@ plane function numberLines_ limits direction = do
return 1
let
+ notBorder :: Bool
+ notBorder = (replicate 2 (circular_ < currentWS) ++ replicate 2 (circular_ > currentWS)) !! fromEnum direction
+
circular_ :: Int
circular_ = circular currentWS
@@ -149,6 +153,15 @@ plane function numberLines_ limits direction = do
]
!! fromEnum direction
+ linear :: Int -> Int
+ linear =
+ [ onLine pred . onColumn pred
+ , onColumn pred . onLine pred
+ , onLine succ . onColumn succ
+ , onColumn succ . onLine succ
+ ]
+ !! fromEnum direction
+
onLine :: (Int -> Int) -> Int -> Int
onLine f currentWS_
| line < areasLine = mod_ columns
@@ -211,12 +224,9 @@ plane function numberLines_ limits direction = do
when (isJust mCurrentWS) $
case limits of
- Finite ->
- when ((replicate 2 (circular_ < currentWS) ++ replicate 2 (circular_ > currentWS)) !! fromEnum direction)
- $ run circular
-
- Circular ->
- run circular
+ Finite -> when notBorder $ run circular
+ Circular -> run circular
+ Linear -> if notBorder then run circular else run linear
gconftool :: String
gconftool = "gconftool-2"