From 9b5773912c88c372a2451d6046fe1fa84c2b8bb4 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Tue, 7 Oct 2008 11:02:29 +0200 Subject: Make pointWithin a top-level binding darcs-hash:20081007090229-25a6b-0c70b5cdfa7809eff60fca8ee911dbfd6970cdea --- XMonad/Operations.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'XMonad/Operations.hs') diff --git a/XMonad/Operations.hs b/XMonad/Operations.hs index 944c592..41e5790 100644 --- a/XMonad/Operations.hs +++ b/XMonad/Operations.hs @@ -423,11 +423,14 @@ floatLocation w = withDisplay $ \d -> do return (W.screen $ sc, rr) where fi x = fromIntegral x - pointWithin :: Integer -> Integer -> Rectangle -> Bool - pointWithin x y r = x >= fi (rect_x r) && - x < fi (rect_x r) + fi (rect_width r) && - y >= fi (rect_y r) && - y < fi (rect_y r) + fi (rect_height r) + +-- | 'pointWithin x y r' returns 'True' if the '(x, y)' co-ordinate is within +-- the 'Rectangle'. +pointWithin :: Position -> Position -> Rectangle -> Bool +pointWithin x y r = x >= rect_x r && + x < rect_x r + fromIntegral (rect_width r) && + y >= rect_y r && + y < rect_y r + fromIntegral (rect_height r) -- | Make a tiled window floating, using its suggested rectangle float :: Window -> X () -- cgit v1.2.3