aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevin Mullins <me@twifkak.com>2008-05-13 11:01:51 +0200
committerDevin Mullins <me@twifkak.com>2008-05-13 11:01:51 +0200
commitac338f11f7e48b4fbd2a377c40f5c39f6e7535f5 (patch)
treed9a3f8534091cab61055f138092f818d70dc95dd
parenta80d05f4a449a319ab47475fc1198c25369f5af1 (diff)
downloadXMonadContrib-ac338f11f7e48b4fbd2a377c40f5c39f6e7535f5.tar.gz
XMonadContrib-ac338f11f7e48b4fbd2a377c40f5c39f6e7535f5.tar.xz
XMonadContrib-ac338f11f7e48b4fbd2a377c40f5c39f6e7535f5.zip
windowRect now compensates for border width
Odd that I have to do (Rectangle x y (w + 2 * bw) (h + 2 * bw)) -- you'd think the window would be centered within the bordered area. darcs-hash:20080513090151-78224-b1520de8a35596af5a49c935d9b56422e945a061.gz
-rw-r--r--XMonad/Actions/WindowNavigation.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/XMonad/Actions/WindowNavigation.hs b/XMonad/Actions/WindowNavigation.hs
index a64520a..46c9f6d 100644
--- a/XMonad/Actions/WindowNavigation.hs
+++ b/XMonad/Actions/WindowNavigation.hs
@@ -45,7 +45,6 @@ import Graphics.X11.Xlib
-- Don't use it! What, are you crazy?
-- TODO:
--- - screen 1: 2x2, screen 2: 1 fs, move from scr 2 to scr 1: center -> border
-- - fix setPosition to use WNState
-- - cleanup
-- - documentation :)
@@ -70,6 +69,7 @@ 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
@@ -155,8 +155,8 @@ windowRects = fmap catMaybes . mapM windowRect . S.toList =<< gets mapped
windowRect :: Window -> X (Maybe (Window, Rectangle))
windowRect win = withDisplay $ \dpy -> do
- (_, x, y, w, h, _, _) <- io $ getGeometry dpy win
- return $ Just $ (win, Rectangle x y w h)
+ (_, x, y, w, h, bw, _) <- io $ getGeometry dpy win
+ return $ Just $ (win, Rectangle x y (w + 2 * bw) (h + 2 * bw))
`catchX` return Nothing
-- Modified from droundy's implementation of WindowNavigation.