diff options
author | Karsten Schoelzel <kuser@gmx.de> | 2007-09-10 11:03:29 +0200 |
---|---|---|
committer | Karsten Schoelzel <kuser@gmx.de> | 2007-09-10 11:03:29 +0200 |
commit | df9292b3d2ccb071af89b4576ebddc5f97db71ab (patch) | |
tree | f08c616430400f3d96aa120825da4e27eac8c004 /StackSet.hs | |
parent | 0ddfabc605c890cda31fe7104cedaa6b6684ed25 (diff) | |
download | xmonad-df9292b3d2ccb071af89b4576ebddc5f97db71ab.tar.gz xmonad-df9292b3d2ccb071af89b4576ebddc5f97db71ab.tar.xz xmonad-df9292b3d2ccb071af89b4576ebddc5f97db71ab.zip |
Fix float behaviour, add shiftWin.
First, if float is called with window which is on a hidden workspace,
then the window will remain on that hidden workspace.
Now the focus should change more as expected:
float w
darcs-hash:20070910090329-eb3a1-ae150bf783b36fb4811e92d81b4917066c8733b7.gz
Diffstat (limited to 'StackSet.hs')
-rw-r--r-- | StackSet.hs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/StackSet.hs b/StackSet.hs index 48006dd..05f8ff2 100644 --- a/StackSet.hs +++ b/StackSet.hs @@ -32,11 +32,11 @@ module StackSet ( swapMaster, swapUp, swapDown, modify, modify', float, sink, -- needed by users -- * Composite operations -- $composite - shift + shift, shiftWin ) where import Prelude hiding (filter) -import Data.Maybe (listToMaybe) +import Data.Maybe (listToMaybe,fromJust) import qualified Data.List as L (delete,deleteBy,find,splitAt,filter) import qualified Data.Map as M (Map,insert,delete,empty) @@ -502,3 +502,12 @@ shift n s | n `tagMember` s && n /= curtag = maybe s go (peek s) | otherwise = s where go w = view curtag . insertUp w . view n . delete' w $ s curtag = tag (workspace (current s)) + +shiftWin :: (Ord a, Eq a, Eq s, Eq i) => i -> a -> StackSet i a s sd -> StackSet i a s sd +shiftWin n w s | from == Nothing = s + | n `tagMember` s && (Just n) /= from = go + | otherwise = s + where go = on n (insertUp w) . on (fromJust from) (delete' w) $ s + curtag = tag (workspace (current s)) + from = findIndex w s + on i f = view curtag . f . view i |