import qualified XMonad StackSet as import qualified Data Map as curre

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import qualified XMonad.StackSet as W
import qualified Data.Map as M
currentStack s = W.stack $ W.workspace $ W.current s
currentList :: X [Window]
currentList = withWindowSet (\s -> return $ W.integrate' $ currentStack s)
unmaximize :: Window -> X ()
unmaximize w = withDisplay $ unmaximize' w
where
unmaximize' w d =
let swd = widthOfScreen s
sht = heightOfScreen s
wd = round $ 0.9*(fromIntegral swd)
ht = round $ 0.9*(fromIntegral sht)
x = round $ (fromIntegral (swd-wd))/2
y = round $ (fromIntegral (sht-ht))/2
s = defaultScreenOfDisplay d
in do float w
io $ resizeWindow d w wd ht
io $ moveWindow d w x y
isFloat :: Window -> X Bool
isFloat w = do
fls <- withWindowSet (return . W.floating)
return (w `M.member` fls)
specialMove w = do
focus w
lst <- currentList
case lst of
[] -> return ()
[x] -> do
is <- isFloat x
if is
then mouseMoveWindow w
else float x >> unmaximize x
_ -> mouseMoveWindow w
...
[ ((modMask, button1), specialMove)
...