aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions/GridSelect.hs
diff options
context:
space:
mode:
authorDominik Bruhn <dominik@dbruhn.de>2008-11-12 14:46:30 +0100
committerDominik Bruhn <dominik@dbruhn.de>2008-11-12 14:46:30 +0100
commitc7aa0dab570f8cebb1379493eaca89462f6c5b1b (patch)
tree7decde76bc6c3abcfb759160cb965252fe1c5330 /XMonad/Actions/GridSelect.hs
parent47cca33d39d65f47baf2a383e5a3c3497f0cb097 (diff)
downloadXMonadContrib-c7aa0dab570f8cebb1379493eaca89462f6c5b1b.tar.gz
XMonadContrib-c7aa0dab570f8cebb1379493eaca89462f6c5b1b.tar.xz
XMonadContrib-c7aa0dab570f8cebb1379493eaca89462f6c5b1b.zip
Simplify code for restriction-calculation and remove compiletime warnings
darcs-hash:20081112134630-ae55e-ef7a0d2837203d784d8298f1d65f49bdffc7400f.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Actions/GridSelect.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/XMonad/Actions/GridSelect.hs b/XMonad/Actions/GridSelect.hs
index 3ea97a4..05dde60 100644
--- a/XMonad/Actions/GridSelect.hs
+++ b/XMonad/Actions/GridSelect.hs
@@ -237,8 +237,10 @@ gridselect gsconfig =
screenHeight = toInteger $ rect_height s;
selectedWindow <- if (status == grabSuccess) then
do
- let restrictX = floor $ ((fromInteger screenWidth)/(fromInteger $ gs_cellwidth gsconfig)-1)/2 ;
- restrictY = floor $ ((fromInteger screenHeight)/(fromInteger $ gs_cellheight gsconfig)-1)/2 ;
+ let restriction :: Integer -> (GSConfig -> Integer) -> Double
+ restriction ss cs = ((fromInteger ss)/(fromInteger $ cs gsconfig)-1)/2
+ restrictX = floor $ restriction screenWidth gs_cellwidth
+ restrictY = floor $ restriction screenHeight gs_cellheight
winmap = zipWith (,) (diamondRestrict restrictX restrictY) windowList
selectedWindow <- evalStateT (do updateAllWindows; eventLoop)
(TwoDState (0,0)