This was quite an annoying issue!
]]>end
]]>When you turn off borders, you must make sure that you TURN OFF borders. Don't set borderWidth to 0; instead you must import XMonad.Layout.NoBorders and then set noBorders somewhere in your layoutHook. Here's my implementation that handles noBorders nicely with a PerWorkspace layout:
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Layout.PerWorkspace
import XMonad.Layout.Reflect
import XMonad.Layout.Spacing
import XMonad.Layout.NoBorders
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName
import XMonad.Hooks.InsertPosition
import XMonad.Util.Dmenu
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
myManageHook = composeAll
[ className =? "net-minecraft-LauncherFrame" --> doShift "4:media"
, className =? "net-minecraft-LauncherFrame" --> doFloat
, manageDocks]
myWorkspaces = ["1:main", "2:social", "3:dev", "4:media", "5:monitor", "6", "7", "8"]
defaultLayout = tiled ||| Mirror tiled ||| Full
where
tiled = spacing 5 $ Tall nmaster delta ratio
nmaster = 1
ratio = 3/5
delta = 5/100
mediaLayout = noBorders $ Full
myLayout = onWorkspace "4:media" mediaLayout $ defaultLayout
main = do
xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmobarrc"
xmonad $ defaultConfig
{
manageHook = insertPosition Below Newer <+> myManageHook
, layoutHook = avoidStruts $ myLayout
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 150
}
, terminal = "urxvt"
, modMask = mod4Mask
, workspaces = myWorkspaces
-- keeps Minecraft in line
, startupHook = setWMName "LG3D"
, borderWidth = 2
-- border colors set to match 256 color terminal PS1
, normalBorderColor = "#0087ff"
, focusedBorderColor = "#5fd700"
} `additionalKeys`
[ ((mod4Mask .|. shiftMask, xK_l), spawn "xscreensaver-command -lock")
, ((mod4Mask, xK_v), spawn "gvim")
, ((mod4Mask, xK_p), spawn "dmenu_run")
]
Minecraft is one of those games which in order for it to function properly, it has to (for lack of a better word) "steal" the mouse. Xmonad won't let it do that. When I load a map (multiplayer or otherwise) it starts me out in the game options screen. Normally I click "return to game," the cursor disappears and I play normally. In Xmonad, it makes the sound for click confirmation but stays in the options. I've tried turning borders off, setting Minecraft to be floating automatically, and setting the WMName to "LG3D" (which works for the screen resizes but not the problem I'm having.)
Currently my only workaround is to run Minecraft in fullscreen mode (F11). Anyone else ran into this problem and managed to fix it?
Thanks in advance :3
]]>