aboutsummaryrefslogtreecommitdiffstats
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
commit6ebe2fb77eebdc2b0b9baa5d56a4e2061153abe9 (patch)
treeff959304a7b1123658cbcd029d6edb67046d0a88 /XMonad
parenta7e3521f357fd66e4faace47260c2fd908e68aa3 (diff)
downloadxmonad-6ebe2fb77eebdc2b0b9baa5d56a4e2061153abe9.tar.gz
xmonad-6ebe2fb77eebdc2b0b9baa5d56a4e2061153abe9.tar.xz
xmonad-6ebe2fb77eebdc2b0b9baa5d56a4e2061153abe9.zip
Make pointWithin a top-level binding
darcs-hash:20081007090229-25a6b-0c70b5cdfa7809eff60fca8ee911dbfd6970cdea.gz
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 ()