diff options
author | Devin Mullins <me@twifkak.com> | 2008-05-13 11:01:51 +0200 |
---|---|---|
committer | Devin Mullins <me@twifkak.com> | 2008-05-13 11:01:51 +0200 |
commit | ac338f11f7e48b4fbd2a377c40f5c39f6e7535f5 (patch) | |
tree | d9a3f8534091cab61055f138092f818d70dc95dd | |
parent | a80d05f4a449a319ab47475fc1198c25369f5af1 (diff) | |
download | XMonadContrib-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.hs | 6 |
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. |