mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-06 23:21:52 -07:00
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 = (view current) . (shiftWin ws w) where current is the current screen/workspace shiftWin ws w is: - view the workspace w is on - set focus on w - shift ws - set focus back to window it was on that workspace unless w was focused shiftWin was add to StackSet.hs
This commit is contained in:
13
StackSet.hs
13
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
|
||||
|
Reference in New Issue
Block a user