diff options
author | Devin Mullins <me@twifkak.com> | 2008-05-13 11:13:13 +0200 |
---|---|---|
committer | Devin Mullins <me@twifkak.com> | 2008-05-13 11:13:13 +0200 |
commit | c44c7b763b7921fa7a1afc60295da7ec2780cab3 (patch) | |
tree | 01a149263891e00e528734c60fd6c4935b446300 /XMonad/Actions | |
parent | ac338f11f7e48b4fbd2a377c40f5c39f6e7535f5 (diff) | |
download | XMonadContrib-c44c7b763b7921fa7a1afc60295da7ec2780cab3.tar.gz XMonadContrib-c44c7b763b7921fa7a1afc60295da7ec2780cab3.tar.xz XMonadContrib-c44c7b763b7921fa7a1afc60295da7ec2780cab3.zip |
X.A.WindowNavigation: comment cleanup
darcs-hash:20080513091313-78224-b2c8aac4caa2fc3bdab6bd97fba458ca7decf222.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r-- | XMonad/Actions/WindowNavigation.hs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/XMonad/Actions/WindowNavigation.hs b/XMonad/Actions/WindowNavigation.hs index 46c9f6d..d819d35 100644 --- a/XMonad/Actions/WindowNavigation.hs +++ b/XMonad/Actions/WindowNavigation.hs @@ -45,8 +45,8 @@ import Graphics.X11.Xlib -- Don't use it! What, are you crazy? -- TODO: --- - fix setPosition to use WNState --- - cleanup +-- - fix setPosition to use WNState smartly +-- - cleanup (including inr) -- - documentation :) -- - tests? (esp. for edge cases in currentPosition) -- - solve the 2+3, middle right to bottom left problem @@ -69,7 +69,6 @@ withWindowNavigationKeys wnKeys conf = do posRef <- newIORef M.empty return conf { keys = \cnf -> M.fromList (map (second (fromWNAction posRef)) wnKeys) `M.union` keys conf cnf } - -- logHook = windowRects >>= io . print } where fromWNAction posRef (WNGo dir) = go posRef dir fromWNAction posRef (WNSwap dir) = swap posRef dir @@ -110,7 +109,6 @@ withTargetWindow adj posRef dir = fromCurrentPoint $ \win pos -> do -- a restart), derives the current position from the current window. Also, -- verifies that the position is congruent with the current window (say, if you -- used mod-j/k or mouse or something). --- TODO: worry about off-by-one issues with inside definition currentPosition :: IORef WNState -> X Point currentPosition posRef = do root <- asks theRoot @@ -130,9 +128,7 @@ currentPosition posRef = do middleOf (Rectangle x y w h) = Point (x + fromIntegral w `div` 2) (y + fromIntegral h `div` 2) - -- return $ fromMaybe (Point 0 0) mp --- TODO: use a smarter algorithm (with memory of last position) setPosition :: IORef WNState -> Point -> Rectangle -> X () setPosition posRef _ (Rectangle x y w h) = do wsid <- gets (W.tag . W.workspace . W.current . windowset) @@ -159,9 +155,8 @@ windowRect win = withDisplay $ \dpy -> do return $ Just $ (win, Rectangle x y (w + 2 * bw) (h + 2 * bw)) `catchX` return Nothing --- Modified from droundy's implementation of WindowNavigation. +-- Modified from droundy's implementation of WindowNavigation: --- TODO: simplify this inr :: Direction -> Point -> Rectangle -> Bool inr D (Point px py) (Rectangle rx ry w h) = px >= rx && px < rx + fromIntegral w && py < ry + fromIntegral h |