I\'m having a annoying problem since I update IntelliJ IDEA Community to this version:
IntelliJ IDEA 2017.2 Build #IC-172.3317.76, built on July 15, 2017 JRE
What ultimately worked for me was adding -Dfocus.follows.mouse.workarounds=true to my custom VM options (Help > Edit Custom VM Options).
-Dfocus.follows.mouse.workarounds=true
I found this in https://youtrack.jetbrains.com/issue/IDEA-173000, mentioned above.
I use a tiling window manager (i3) which I suspect is related.