XMonad gaps in fullscreen

I am trying to set up XMonad so that multiple windows have gaps between them. The relevant part of my config file is as follows

import XMonad.Layout.Spacing

followed later by

myLayout = tiled ||| Mirror tiled ||| Full
    tiled = spacing 5 $ Tall nmaster delta ratio
    nmaster = 1
    ratio = 1/2
    delta = 3/100

The problem is that when one window occupied the whole screen there are gaps along the border. Is there a way to adjust my configuration so that these gaps do not appear when there is only one window?

Have a look at smartSpacing: (see Xmonad Spacing Docs)

Surrounds all windows with blank space, except when the window is the
only visible window on the current workspace.

I.e., changing

tiled = spacing 5 $ Tall nmaster delta ratio


tiled = smartSpacing 5 $ Tall nmaster delta ratio

should to the trick.

Answered By: Psirus
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.