aboutsummaryrefslogtreecommitdiffstats
path: root/FlexibleResize.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-08-07 22:20:16 +0200
committerDavid Roundy <droundy@darcs.net>2007-08-07 22:20:16 +0200
commita50cd3c8312bd05e8d03d88c7c886600dd148ef2 (patch)
tree623d3dd532f0cb9ae998c08bf66984faeb711d10 /FlexibleResize.hs
parentc0f2103f05549c8616000915394812874efa64b2 (diff)
downloadXMonadContrib-a50cd3c8312bd05e8d03d88c7c886600dd148ef2.tar.gz
XMonadContrib-a50cd3c8312bd05e8d03d88c7c886600dd148ef2.tar.xz
XMonadContrib-a50cd3c8312bd05e8d03d88c7c886600dd148ef2.zip
make FlexibleResize use new mouseDrag properly.
darcs-hash:20070807202016-72aca-4356463b45f6fc685db6a238728e284ecb6e17c1.gz
Diffstat (limited to 'FlexibleResize.hs')
-rw-r--r--FlexibleResize.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/FlexibleResize.hs b/FlexibleResize.hs
index 9d5d098..f031a8f 100644
--- a/FlexibleResize.hs
+++ b/FlexibleResize.hs
@@ -45,12 +45,13 @@ mouseResizeWindow w = whenX (isClient w) $ withDisplay $ \d -> do
(cx, fx, gx) = mkSel west width pos_x
(cy, fy, gy) = mkSel north height pos_y
io $ warpPointer d none w 0 0 0 0 cx cy
- mouseDrag $ \(_, _, _, ex, ey, _, _, _, _, _) -> do
- wa' <- getWindowAttributes d w
- let [px, py] = map (fromIntegral . ($ wa')) [wa_x, wa_y]
- moveResizeWindow d w (fromIntegral $ fx px ex) (fromIntegral $ fy py ey)
- `uncurry` applySizeHints sh (gx ex, gy ey)
- float w
+ mouseDrag (\ex ey -> do
+ wa' <- io $ getWindowAttributes d w
+ let [px, py] = map (fromIntegral . ($ wa')) [wa_x, wa_y]
+ io $ moveResizeWindow d w (fromIntegral $ fx px (fromIntegral ex))
+ (fromIntegral $ fy py (fromIntegral ey))
+ `uncurry` applySizeHints sh (gx $ fromIntegral ex, gy $ fromIntegral ey))
+ (float w)
where
firstHalf :: CInt -> Position -> Bool
firstHalf a b = fromIntegral a * 2 <= b