mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
make DwmPromote compile
This commit is contained in:
parent
68ecf2071a
commit
6e2496c77f
@ -33,13 +33,13 @@ import qualified Data.Map as M
|
|||||||
dwmpromote :: X ()
|
dwmpromote :: X ()
|
||||||
dwmpromote = windows promote
|
dwmpromote = windows promote
|
||||||
|
|
||||||
promote :: (Integral i, Ord a) => StackSet i j a -> StackSet i j a
|
promote :: (Integral i, Integral j, Ord a) => StackSet i j a -> StackSet i j a
|
||||||
promote w = maybe w id $ do
|
promote w = maybe w id $ do
|
||||||
a <- peek w -- fail if null
|
a <- peek w -- fail if null
|
||||||
stack <- index (current w) w
|
stack <- index (current w) w
|
||||||
let newstack = swap a (next stack a) stack
|
let newstack = swap a (next stack a) stack
|
||||||
return $ w { stacks = M.adjust (\(f,_) -> (f, newstack)) (current w) (stacks w),
|
return . raiseFocus (head newstack) $
|
||||||
focus = M.insert (current w) (head newstack) (focus w) }
|
w { stacks = M.adjust (\(f,_) -> (f, newstack)) (current w) (stacks w) }
|
||||||
where
|
where
|
||||||
next s a | head s /= a = head s -- focused is not master
|
next s a | head s /= a = head s -- focused is not master
|
||||||
| length s > 1 = s !! 1
|
| length s > 1 = s !! 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user