summaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorSpencer Janssen <spencerjanssen@gmail.com>2008-10-07 11:02:29 +0200
committerSpencer Janssen <spencerjanssen@gmail.com>2008-10-07 11:02:29 +0200
commit9b5773912c88c372a2451d6046fe1fa84c2b8bb4 (patch)
treeff959304a7b1123658cbcd029d6edb67046d0a88 /XMonad
parent1001713945e65d9e9cdd9b6c90ab0bad70c4a3a3 (diff)
downloadmetatile-9b5773912c88c372a2451d6046fe1fa84c2b8bb4.tar
metatile-9b5773912c88c372a2451d6046fe1fa84c2b8bb4.zip
Make pointWithin a top-level binding
darcs-hash:20081007090229-25a6b-0c70b5cdfa7809eff60fca8ee911dbfd6970cdea
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Operations.hs13
1 files changed, 8 insertions, 5 deletions
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 ()