From a50cd3c8312bd05e8d03d88c7c886600dd148ef2 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Tue, 7 Aug 2007 22:20:16 +0200 Subject: make FlexibleResize use new mouseDrag properly. darcs-hash:20070807202016-72aca-4356463b45f6fc685db6a238728e284ecb6e17c1.gz --- FlexibleResize.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'FlexibleResize.hs') 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 -- cgit v1.2.3