Getting Jetbrains IDEs to work sanely on XMonad

Posted on November 27, 2019

JWT based applications require setting WMNAME in xmonad to “LG3D”. But as it turned out that was a partial solution. Especially in the case of Jetbrains developed IDEs.

There was a new problem that I was experiencing recently, so when I start Android studio, intellij, pycharm. When I start the IDE it show a pop-up window. Upon closing it all I saw was grey/stuck screen. The menu bar items where still clickable and to get around this problem I had to close and reopen the project.

As you might imagine, this gets fairly irritating if you are closing and opening the IDE quite often. So after lot of DDG-ing, I found the solution here -> Jetbrains Forum

Add the following to your xmonad.hs config file

import Data.List

-- IntelliJ fix
(~=?) :: Eq a => Query [a] -> [a] -> Query Bool
q ~=? x = fmap (isInfixOf x) q

manageIdeaCompletionWindow = (className =? "jetbrains-studio") <&&> (title ~=? "win") --> doIgnore

And add it to the manageHook

{...
manageHook = (manageHook) <+> manageIdeaCompletionWindow