mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-15 04:05:53 -07:00
Simplify code for restriction-calculation and remove compiletime warnings
This commit is contained in:
@@ -237,8 +237,10 @@ gridselect gsconfig =
|
|||||||
screenHeight = toInteger $ rect_height s;
|
screenHeight = toInteger $ rect_height s;
|
||||||
selectedWindow <- if (status == grabSuccess) then
|
selectedWindow <- if (status == grabSuccess) then
|
||||||
do
|
do
|
||||||
let restrictX = floor $ ((fromInteger screenWidth)/(fromInteger $ gs_cellwidth gsconfig)-1)/2 ;
|
let restriction :: Integer -> (GSConfig -> Integer) -> Double
|
||||||
restrictY = floor $ ((fromInteger screenHeight)/(fromInteger $ gs_cellheight gsconfig)-1)/2 ;
|
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
|
winmap = zipWith (,) (diamondRestrict restrictX restrictY) windowList
|
||||||
selectedWindow <- evalStateT (do updateAllWindows; eventLoop)
|
selectedWindow <- evalStateT (do updateAllWindows; eventLoop)
|
||||||
(TwoDState (0,0)
|
(TwoDState (0,0)
|
||||||
|
Reference in New Issue
Block a user