WindowNavigation and Spacing Issue

Hello everyone! when using WindowNavigation and Spacing together, the window navigation doesn't work. If the 'spacing 2' is removed the navigation works. I like both the features. Can you please help me set up window spacing and easy window navigation? Try out this minimal example to see the issue - NOTE: you have to spawn at least three terminals to be able to see it): import XMonad import Data.Monoid import System.Exit import qualified XMonad.StackSet as W import qualified Data.Map as M import XMonad.Layout.WindowNavigation import XMonad.Layout.Spacing myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ [ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf) -- Quit xmonad , ((modm .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) -- Restart xmonad , ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart") -- WindowNavigation , ((modm, xK_l), sendMessage $ Go R) , ((modm, xK_h ), sendMessage $ Go L) , ((modm, xK_k ), sendMessage $ Go U) , ((modm, xK_j ), sendMessage $ Go D) ] myLayout = windowNavigation $ spacing 2 tiled where tiled = Tall nmaster delta ratio nmaster = 1 ratio = 1/2 delta = 3/100 main = xmonad defaultConfig { terminal = "xterm", keys = myKeys, layoutHook = myLayout } I am running xmonad 0.9.1. Thank you David H.

Hey David, On Sun, Aug 01, 2010 at 02:33:06PM +0200, David Hrachovy wrote:
when using WindowNavigation and Spacing together, the window navigation doesn't work. If the 'spacing 2' is removed the navigation works. I like both the features. Can you please help me set up window spacing and easy window navigation?
This seems to be caused by the fact that WindowNavigation chooses the window to switch to using a single point in the current window, not the window itself. The scenario you described looks like this: +---+ +---+ | | | | | | +---+ | * | | | +---+ | | | | +---+ +---+ As there is no window to the right of that point, WindowNavigation doesn't switch you to any. You can solve this by switching the order of layout modifiers -- that is, windowNavigation first, spacing second:
myLayout = spacing 2 $ windowNavigation $ tiled
This way, WindowNavigation doesn't "see" the gaps and works just like if there were none. (Also, there is a module called XMonad.Actions.WindowNavigation, which claims to be a rewrite of the one you're using, and it works even when applied after spacing. I have no idea which of these is better, though.) Regards, -- Tomáš Janoušek, a.k.a. Liskni_si, http://work.lisk.in/
participants (2)
-
David Hrachovy
-
Tomáš Janoušek