From ac338f11f7e48b4fbd2a377c40f5c39f6e7535f5 Mon Sep 17 00:00:00 2001 From: Devin Mullins Date: Tue, 13 May 2008 11:01:51 +0200 Subject: 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 --- XMonad/Actions/WindowNavigation.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'XMonad/Actions/WindowNavigation.hs') 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. -- cgit v1.2.3