aboutsummaryrefslogtreecommitdiffstats
path: root/FlexibleResize.hs
diff options
context:
space:
mode:
Diffstat (limited to '')
-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