make FlexibleResize use new mouseDrag properly.

This commit is contained in:
David Roundy
2007-08-07 20:20:16 +00:00
parent cc82ef418f
commit 504d011dd6

View File

@@ -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