I am using Manjaro with i3wm and Pycharm is in vim mode. When I am using Pycharm and I change to a workspace and then come back to Pycharm, I have to click on the text for the "writing cursor" to come back.
(Sorry for my bad english)
Go to Help -> Edit custom properties
(select yes if it asks you to create a file) and then paste in suppress.focus.stealing=false
and restart the editor.