mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 20:21:51 -07:00
Reduce head usage
This commit is contained in:
@@ -80,11 +80,9 @@ applyPosition :: (LayoutClass l a, Eq a) =>
|
||||
applyPosition pos wksp rect = do
|
||||
let stack = W.stack wksp
|
||||
let ws = W.integrate' stack
|
||||
if null ws then
|
||||
runLayout wksp rect
|
||||
else do
|
||||
let firstW = head ws
|
||||
let other = drop 1 ws
|
||||
case ws of
|
||||
[] -> runLayout wksp rect
|
||||
(firstW : other) -> do
|
||||
let filtStack = stack >>= W.filter (firstW /=)
|
||||
wrs <- runLayout (wksp {W.stack = filtStack}) rect
|
||||
return $ first ((firstW, place pos other rect) :) wrs
|
||||
|
@@ -91,7 +91,7 @@ instance (LayoutClass l (), LayoutClass l1 a, LayoutClass l2 a, Read a, Show a,
|
||||
handleMessage super (SomeMessage ReleaseResources)
|
||||
return ([(w,rinput)], Just $ C2 [w] [w] super' l1' l2')
|
||||
arrange origws =
|
||||
do let w2' = case origws `intersect` w2 of [] -> [head origws]
|
||||
do let w2' = case origws `intersect` w2 of [] -> take 1 origws
|
||||
[x] -> [x]
|
||||
x -> case origws \\ x of
|
||||
[] -> init x
|
||||
|
Reference in New Issue
Block a user