aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/StackSet.hs
diff options
context:
space:
mode:
authorDevin Mullins <me@twifkak.com>2008-09-11 07:39:09 +0200
committerDevin Mullins <me@twifkak.com>2008-09-11 07:39:09 +0200
commit3fee57a0c800f3222778359d73823f97c9d546ae (patch)
treec53f64016659b2c88e7ce5aaf3e81e2fdc91bd1c /XMonad/StackSet.hs
parent1b780c7dffe376604590901d96296546de4c0449 (diff)
downloadxmonad-3fee57a0c800f3222778359d73823f97c9d546ae.tar.gz
xmonad-3fee57a0c800f3222778359d73823f97c9d546ae.tar.xz
xmonad-3fee57a0c800f3222778359d73823f97c9d546ae.zip
add W.shiftMaster, fix float/tile-reordering bug
darcs-hash:20080911053909-78224-d050fdbedac4eb39a96f30ec0679a9b67d274091.gz
Diffstat (limited to 'XMonad/StackSet.hs')
-rw-r--r--XMonad/StackSet.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/XMonad/StackSet.hs b/XMonad/StackSet.hs
index 62c3c34..bd1c4b6 100644
--- a/XMonad/StackSet.hs
+++ b/XMonad/StackSet.hs
@@ -42,7 +42,7 @@ module XMonad.StackSet (
insertUp, delete, delete', filter,
-- * Setting the master window
-- $settingMW
- swapUp, swapDown, swapMaster, modify, modify', float, sink, -- needed by users
+ swapUp, swapDown, swapMaster, shiftMaster, modify, modify', float, sink, -- needed by users
-- * Composite operations
-- $composite
shift, shiftWin,
@@ -508,6 +508,15 @@ swapMaster = modify' $ \c -> case c of
-- natural! keep focus, move current to the top, move top to current.
+-- | /O(s)/. Set the master window to the focused window.
+-- The other windows are kept in order and shifted down on the stack, as if you
+-- just hit mod-shift-k a bunch of times.
+-- Focus stays with the item moved.
+shiftMaster :: StackSet i l a s sd -> StackSet i l a s sd
+shiftMaster = modify' $ \c -> case c of
+ Stack _ [] _ -> c -- already master.
+ Stack t ls rs -> Stack t [] (reverse ls ++ rs)
+
-- | /O(s)/. Set focus to the master window.
focusMaster :: StackSet i l a s sd -> StackSet i l a s sd
focusMaster = modify' $ \c -> case c of