mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-26 09:41:52 -07:00
make FlexibleResize use new mouseDrag properly.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user