[xmonad] XMonad is not playing well with floating windows

Wirt Wolff wirtwolff at gmail.com
Tue Sep 8 10:12:56 EDT 2009


Excerpts from Massimo Gengarelli's message of Tue Sep 08 02:51:15 -0600 2009:
> Hi everyone,
> I'm quite new to XMonad and haskell itself, so I really don't know if
> it's a problem of my configuration file or it's the default behaviour of
> XMonad.
> Everytime I make a window floating, the tiled windows in background swap
> between themselves, without any reason or fixed rule. If I replace them
> in the order I want, they re-swap as soon as I move/resize the floated window.
> I'm using Linux Gentoo and XMonad 0.8.1.
> Thanks in advance.
>

The darcs version of XMonad uses less disruptive method for mousing
floating windows. You could use the xmonad-contrib-darcs ebuild
from the haskell overlay (uses xmonad-darcs and haskell
x11-darcs too). Or copy the following shiftMaster from darcs
XMonad.StackSet into your xmonad.hs and use the newer mouse
bindings:

-- other imports
import qualified XMonad.StackSet as W
import qualified Data.Map as M

-- | /O(s)/. Set the master window to the focused window.
-- The other windows are kept in order and shifted down on the stack,
-- as if you just hit mod-shift-k a bunch of times.
-- Focus stays with the item moved.
shiftMaster :: StackSet i l a s sd -> StackSet i l a s sd
shiftMaster = modify' $ \c -> case c of
    Stack _ [] _ -> c     -- already master.
        Stack t ls rs -> Stack t [] (reverse ls ++ rs)

darcsMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
    [ ((modm, button1), (\w -> focus w >> mouseMoveWindow w
                                       >> windows W.shiftMaster))
    , ((modm, button2), (\w -> focus w >> windows W.shiftMaster))
    , ((modm, button3), (\w -> focus w >> mouseResizeWindow w
                                       >> windows W.shiftMaster))
    ]

main = xmonad defaultConfig {
      mouseBindings = darcsMouseBindings
    -- other changes
    }

regards,

--
wmw


More information about the xmonad mailing list